2023-04-05 06:24 PM
Hi all.
I tried to use GPIOB4 as output but failed.
But it works as I2C SCL so I guess the chip ok.
I cant find alternate function for it.
Someone please help me.
2023-04-06 08:23 AM
How do you know it failed?
Post the code used to configure and write output value of GPIO.
2023-04-06 05:16 PM
GPIO_DeInit(GPIOB):
GPIO_Init(GPIOB, GPIO_PIN_4, GPIO_MODE_OUT_PP_HIGH_SLOW);
GPIO_WriteHigh(GPIOB, GPIO_PIN_4);
It only can pull low not pull up.
The same as GPIOB 5.
Might be both only OD not PP?
2023-04-07 03:06 AM
The problem is what I expected. I2C pins are true open-drain pins, see datasheet. This means they can't drive level '1'. Also they don't have internal pull-up resistor. Use them to drive level '0' or try with an external pull-up resistor.
2023-04-07 05:19 AM
Thank you.
STM8 much frustating than STM32 and other 8bit micros.
Dont know why ST made them complicated
2023-04-07 06:25 AM
I don't agree with you. You are complicating. You have to read datasheet and manual. Also the fact that can only drive level '0, usually is not a problem.
STM8 is a powerful 8bit MCU.
Do you already worked with any STM32 MCU?
And the RISC instruction set of CM0+ MCUs!
Also aligned access to memory!