This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi all,
I'm trying to implement a basic I2C slave who always replies the same data when the master tries to read a byte.
The data is 0xbb.
When I try to read in the first time after reset the microcontroller, the data is received correctly, as expected. But, if I try to read again, the data received in the master is corrupted.
My master is already tested and works well with another device.
Here is my code for I2C ISR.
void isr_i2c_slave_offboard_isolated(void) { if (I2CSlaveIntStatus(I2C_OFFBOARD_ISO_SLAVE_BASE, I2C_SLAVE_INT_DATA)) { g_ui32Status = I2CSlaveStatus(I2C_OFFBOARD_ISO_SLAVE_BASE); if (g_ui32Status & I2C_SLAVE_ACT_RREQ) { g_ui32DataRx = I2CSlaveDataGet(I2C_OFFBOARD_ISO_SLAVE_BASE); } if (g_ui32Status & I2C_SLAVE_ACT_TREQ) { I2CSlaveDataPut(I2C_OFFBOARD_ISO_SLAVE_BASE, 0xbb); } } I2CSlaveIntClear(I2C_OFFBOARD_ISO_SLAVE_BASE); I2CSlaveIntClearEx(I2C_OFFBOARD_ISO_SLAVE_BASE, I2C_SLAVE_INT_DATA); }
I need to check something else in ISR?
Thanks!