2019-06-19 09:43 AM
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:
STOP part zoomed:
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?
2019-06-19 09:50 AM
It looks like, reading DR back, right after setting START|STOP flag does the trick.. Is it a valid solution?
Now I only see single 6 (TXE=1 BTF=1 condition).. Than 2 comes, which is START=1