Skip to main content
mmensch
Associate III
November 3, 2014
Question

How to deal with I2C acknowledge failure

  • November 3, 2014
  • 1 reply
  • 1322 views
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
    This topic has been closed for replies.

    1 reply

    mmensch
    mmenschAuthor
    Associate III
    November 3, 2014
    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