cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 I2C BTF interrupt is generated repeatedly until the stop is generated

denizcan
Associate II

I've been developing my own I2C interface. When the BTF is set, I issue STOP. However, the interrupt routine is repeatedly called until the STOP is generated..

In document it says that BTF is cleared by hardware after a start or stop condition in transmission. It looks like, setting STOP does not clear. The hardware waits until STOP is detected on the line..

Here is the whole transaction:

0690X000008ixxfQAA.png

STOP part zoomed:

0690X000008ixy4QAA.png

The numbers in the last row is simple trace output via pins. 1 means irq routine started, 6 means BTF flag is set and is being processed.. The routine is called repeatedly until a stop condition is generated..

How can I prevent module to generate Irq's until the stop is generated?

1 REPLY 1
denizcan
Associate II

It looks like, reading DR back, right after setting START|STOP flag does the trick.. Is it a valid solution?

0690X000008ixysQAA.png

Now I only see single 6 (TXE=1 BTF=1 condition).. Than 2 comes, which is START=1