Hi all,
i'm having an issue to make a TMS320f28052f work as an i2C slave.
When i'm doing a i2C write operation, the slave receive well (ACK on SDA and data is transmitted on the SDA line)
But when a i2C read operation is carried on, the slave do an ACK on SDA but never send the actual data. But I2C_TX_ISRC interrupt is triggered on the slave.
Trace of i2C read operation on device address 5 :
The init function is :
i2cHandle->I2CMDR.bit.IRS = 0; // Initialize I2C i2cHandle->I2COAR = i2C_own_adress; i2cHandle->I2CSAR = 0x0000; // i2c clock speed 100000 hz i2cHandle->I2CPSC.all = 6; // Prescaler - need 7-12 Mhz on module clk i2cHandle->I2CCLKL = 10; // NOTE: must be non zero i2cHandle->I2CCLKH = 5; // NOTE: must be non zero i2cHandle->I2CIER.all = 0x00; // Enable __interrupts i2cHandle->I2CIER.bit.RRDY = 1; i2cHandle->I2CIER.bit.AAS = 1; i2cHandle->I2CIER.bit.XRDY = 1; i2cHandle->I2CIER.bit.ARDY = 1; i2cHandle->I2CIER.bit.NACK = 1; i2cHandle->I2CIER.bit.SCD = 1; i2cHandle->I2CEMDR.bit.BCM = 0; i2cHandle->I2CMDR.all = 0x0020;
In the ISR, i have the following code :
if(i2cObj->I2CISRC.all & I2C_TX_ISRC == I2C_TX_ISRC) { // Setup number of bytes to send i2cObj->I2CCNT = 1; // Setup data to send i2cObj->I2CDXR = data; }
Found a similar post at (https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/426586#pi316717=1
Can anyone give me hints ?
Thanks