2025-12-06 7:53 AM
Hey,
i didnot find any AFR4 in option byte to set PB4-SCL and PB5-SDA of STM8s003F3. Can st will help how to enable it for I2c hardware peripheral.?
2025-12-06 10:29 AM
You don't need to configure any AFR bit to use I2C peripheral. Configure I2C peripheral and PB4 will be SCL and PB5 will be SDA.
2025-12-07 8:29 AM
STM8S103 can use i2c after reset and works well, but STM8S003 can't do. i have tried all possible solution but i2c communication somehow not happening in STM8S003 MCU . can u provide simple code to test I2c in STM8s003 using EEPROM 24C32 or DS1307 RTC? pls provide working code main.c,ds1307.c/h
2025-12-07 11:13 AM
STM8S003 is compatible with STM8S103. So the problem is in other side. Maybe option bytes OPT2/AFRx is programmed with a value different from 0. The problem can also be with the board or I2C_SDA and I2C_SCL pins.
Do you have a pull-up resistor in I2C_SDA and I2C_SCL pins?
2025-12-08 8:40 AM
yes.pullup added 4.7K for RTC module. and RTC module also tested in arduino uno board. the module is ok.