Skip to main content
Visitor II
December 15, 2017
Question

STM8S001J3 open-drain mode

  • December 15, 2017
  • 1 reply
  • 898 views
Posted on December 15, 2017 at 08:22

Hi

I would like to use open-drain mode for PB5 pin of STM8S001J3.

GPIO_DeInit(GPIOA);

GPIO_Init(GPIOB, GPIO_PIN_5, GPIO_MODE_OUT_OD_LOW_FAST);

I do not know why the voltage goes down even if I set it like the code above.

Input voltage : 6V

PB5 output voltage: 4V is output.

#stm8
    This topic has been closed for replies.

    1 reply

    Visitor II
    January 2, 2018
    Posted on January 02, 2018 at 18:22

    I expect the GPIO protection diodes to cause the voltage drop (unless you inject more than 4mA, which may damage the chip). If you need a true open drain to switch loads at U>VDD better use an external FET.