Dear all.
When I use I2C FIFO to communicate with an I2C EERPOM, there was something wrong: the data were not what I put into FIFO register. That was because, after transmission completed, the FIFO transmit registers status ( I2CFFTX[ TXFFST ] ) was 15 instead of zero. As a result, the data in next transmission were unexpected.
I had to manually clear I2CFFTX[ TXFFRST ] to set I2CFFTX[ TXFFST ] to 0, then the communication was correct.
Is it a bug of F28335?
The initiate code of I2C module is:
I2caRegs.I2CPSC.all = 14; //150MHz
I2caRegs.I2CCLKL = 48; //Clock pulse width Low is 5.3us
I2caRegs.I2CCLKH = 42; //Clock pulse width High is 4.7us, so clock pulse frequency is 100KHz
I2caRegs.I2CIER.all = 0x24; //Enable SCD & ARDY interrupts
I2caRegs.I2CMDR.all = 0x0020; //take I2C out of reset. Stop I2C when suspend
I2caRegs.I2CFFTX.all = 0x6040; //Enable FIFO mode and TXFIFO, clear TXFFINT, disable TXFFINT
I2caRegs.I2CFFRX.all = 0x2040; //Enable RXFIFO, clear RXFFINT, disable RXFFINT
thanks!
tony Zhao