cancel
Showing results for 
Search instead for 
Did you mean: 

STM8S103 I2C issue

sthvw
Associate II

Hi,
I like to control this cute STM8S103 uC with c-code without using any library. I created many succesfully projects but now I want to write a I2C driver.
I configured the uC portpins PB4/PB5 being SCL/SDA as Psuedo Open Drain and as Ouput and the I2C peripheral clock by default is enabled at powerup and I connected a pullup resistor of 5K6 on both signals. When de I2C peripheral is enabled only the SDA signal goes high as the SCL signal stays low. I executed many experiments and one time both signals got high when enabeling the I2C peripheral. But now the SCL still keeps grounded. What can be wrong here?

1 REPLY 1

Very little here to work on from example code or wiring, and to what..

>>What can be wrong here?

Short on the board

Other things on the board clamping or driving the pins, perhaps the slave device?

Wrong pins being looked at

Wrong pins being configured

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..