2017-12-14 11:22 PM
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.
#stm82018-01-02 09:22 AM
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.