Question
Unable to communicate to external peripheral device using I2C.
I am using STM8L Discovery board, and want to communicate with external memory and humidity sensor which requires I2C protocol for communication.
I am using STM8l15x standard peripheral library, but unable to communicate. I found the following problems while debug:
- If not connecting any pull-up resistor, not getting acknowledgment from slave device and getting stuck in while((I2C1->SR1 & I2C_SR1_ADDR) == 0) loop
- If connecting pull-up resistor on both SDA and SCL (1k and 4.7K tried), unable to generate start condition.
Please help me out how can I resolve it?
Thank you so much in advance.
