AnsweredAssumed Answered

I2C Master Error Interrupt Not Firing - STM32F407

Question asked by mjbcswitzerland on Mar 18, 2013
Latest reply on Mar 20, 2013 by mjbcswitzerland
Hi All

I have a driver for I2C master mode which has been working correctly under normal conditions. It is interrupt driven so the interrupt fires for each received/transmitted byte.

If however non-present slaves are addressed the I2C bus hangs in a state with the SCL line low since the slave didn't acknowledge.

In order to detect this I have activated the Error Interrupt (ITERREN) and would like to terminate the bus correctly (stop condition or repeated start) so that the bus can be used further.

However, when the slave doesn't answer the AF bit gets set in SR1 as expected, the interrupt is enabled (0x072a in CR2) - this enables ITERREN, ITEVTEN and ITBUFEB - but there is never an interrupt from the I2C channel. All other interrupts are operating normally in the system.

I am testing on I2C1 and I get no problem as long as I address a slave that acknowledges (always interrupts).

Does anyone know how to get the error interrupt to fire??

Regards

Mark

Outcomes