cancel
Showing results for 
Search instead for 
Did you mean: 

STM8S001J3 open-drain mode

Sang hyeon Jeong
Associate II
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
1 REPLY 1
Thomas G
Associate II
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.