Part Number: TMS320F28335
I use my F28335 in I2C slave mode.
The I2C master is sending 4-byte messages, and the F28335 reads the messages in the I2C FIFO ISR:
interrupt void i2c_fifo_isr(void)
{
if (I2caRegs.I2CFFRX.bit.RXFFINT == 1)
{
Uint16 i=0;
for (i=0; i<4; i++)
receivedMessage[i] = I2caRegs.I2CDRR;
}
I2caRegs.I2CFFRX.bit.RXFFINTCLR = 1;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP8;
}
The problem: After some period of time I seem to be loosing sync.
For example, the master is sending messages with the content "ABCD" every 33[ms].
After a while, in my 4-byte buffer (receivedMessage), I see "BCDA" or "CDAB" (instead of "ABCD").
Is there a way to know that byte "A" was received after a start signal and that a stop signal was received after byte "D"?
Best regards,
Yiftah