cancel
Showing results for 
Search instead for 
Did you mean: 

How to deal with I2C acknowledge failure

mmensch
Associate II
Posted on November 03, 2014 at 14:25

Hi,

I am using STM32L151 and try to communicate over I2C with STM32L151 as master. When I send out an adress to a slave that is not there I don't get an ACK, SDA stays high. With my configuration this results in an interrupt coming out at I2C1_ER_IRQHandler. Also SCL stays low after the ninth pulse.

Now I need to get rid of the AF bit and resolve the bus to be able to try again. I clear AF in SR1 and set STOP in CR1 as mentioned in RM0038 page 664 but it has no effect. I tried an __ISB() after clearing AF, also no luck. I also tried to set START and STOP in CR1 - no change.

Any ideas what I can do. Is there something I completely missed?

Thanks a lot

Martin
1 REPLY 1
mmensch
Associate II
Posted on November 03, 2014 at 16:36

Sorry for this post, I found an error in my code that caused this behaviour.

Clearing AF and setting STOP works.

Martin