2025-02-22 01:14 PM
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?
2025-02-22 07:29 PM
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