cancel
Showing results for 
Search instead for 
Did you mean: 

STM8s003F3_I2c not working

BAS-BLEU
Associate III

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.?

4 REPLIES 4
AA1
Senior III

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.

 

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

 

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?

 

yes.pullup added 4.7K for RTC module. and RTC module also tested in arduino uno board. the module is ok.