We are trying to transmit bulk of data (i.e. 2981 bytes) over I2C bus.
We have implemented the bulk data transmission logic based on IF bit(assertion/ deassertion ).
As per our observation during transmission at some point IF bit doesn't asserts due to which our approach is failing.
Also we have tried this approach for short data (i.e. 10 bytes) and it works fine.
Below is the code snippet for bulk data transmission :
unsigned short I2C_ByteCNT=0; // source data buffer index
while (I2C_ByteCNT < 2981)
{
*(I2C_DIO(1)) = ((LocalFlashBuf[I2C_ByteCNT]) << 24); // LocalFlashBuf is a source data buffer
I2C_ByteCNT++;
//wait till Tx is in progress
while ((*(I2C_SR(1)) & 0x02000000) == 0x00000000); //wait for IF bit assertion
//clear IF flag in status register
*(I2C_SR(1)) &= ~(0x02000000);
}
Please guide us the for bulk data transmission.@