Hi,
I'm writing my own low level interrupt driven interface for the i2c peripheral in the the C6748 and am getting spurrious ICXRDY interrupts on the first character I transmit. I've read the I2C Tips Wiki page and am setting up the device consistent with the recommendations. After clearing the interrupt status and vector registers, I set the mask register to allow NACK, ARDY and ICXRDY interrupts through. I set the count, address and mode registers. I then go off and loop, writing a character and waiting for the ICXRDY interrupt prior to sending the next character. Sometimes I get an ICXRDY interrupt between the step where I set the mode register (enabling the interface for Tx mode) and sending the first character. This fools my code into thinking I can send the second character directly after the first, and the second character overwrites the first in the transmit buffer with the end effect that only the second character appears on the i2c bus.
I've tried always waiting on ICXRDY interrupt after setting up the mode register, but an ICXRDY interrupt is not always issued. I can detect the spurrious interrupt in one of two manners:
- When I receive the interrupt (with the mask set as above) and read the vector register in the ISR, it returns 0. This is easy to identify and ignore.
- When I receive the interrupt, use the 32-bit timer to check how quickly the interrupt occurs after the mode register was written. Normally it takes about 90uS. If it's a spurrious interrupt it takes only about 10uS. Although relatively easy to identify, the code for this is a kludge.
I've searched for erratta and found nothing like this described. So, any suggestions on what I might be doing wrong? Or is there erratta that I simply haven't uncovered.
Thanks,
Dale