2009-10-12 06:29 AM
How to handle IIC bus while the slave hold the SDA low
2011-05-17 06:05 AM
Hi,
I'm using the STM8S105K4 with a IIC slave device, while power-on, the IIC bus always in the 'busy' state, that is , the SDA line always low. How can I overcome this issue? (NOT use HW Reset.., thanks) Jason2011-05-17 06:05 AM
Hi Jason,
The External pull-up resistances (4.7k) are needed on SCL and SDA, please check this point. Regards mozra2011-05-17 06:05 AM
Hi,
Both the SDA & SCL are pulled high with 4.7K resistor. I can access the I2C slave in debug, while first time power on, the slave seems hold the SDA low (I don't know why), if I press ''reset'' button, the mcu and the I2C slave work well. I'vd see a document of Silabs's C8051 series, they handled such problem by changing the SDA & SCL pin to GPO mode (open drain) and wait for SDA high, but I don't know how to configure the STM8S105 from alternate function (I2C) to GPO mode, any idea? regards, Jason2011-05-17 06:05 AM
Hi Jason,
It can happen that it is the master that forces the line in the low state!!! What is the master device used in your case? The SDA & SCl are configured as alternate function when enabling the I2C, you don't have access to reconfigure the I/O as alternate function but you can add a software pull-up on the I/O: GPIOE->CR1 = 0x06; Please try this and keep us informed Regards mozra