AnsweredAssumed Answered

Lots of unexpected I2C send interrupts

Question asked by pelle on Nov 29, 2011
Latest reply on Dec 7, 2011 by MMA

I am working on I2C communication with a pressure sensor (from an aduc7020), and I my send/transmit routines are handled by interrupts, i.e.

 

FIQEN = GP_TIMER_BIT | SM_MASTER1_BIT;

 

I have two counters that register every interrupt triggered, one for transmits and one for receives. Like this:

 

if ((FIQSTA & SM_MASTER1_BIT) &&
    (I2C1MSTA & 0x04)) {
    ++tx_counter;
}
if ((FIQSTA & SM_MASTER1_BIT) &&
    (I2C1MSTA & 0x08)) {
    ++rx_counter;
}
The problem that I am experiencing is that I get a lot more TX than RX-interrupts. They shouldn't be equal, but at least close to each other. As it is now, the transmit counter is ~10x larger than the rx counter after a few seconds. Any ideas why this could be?

Outcomes