Other Parts Discussed in Thread: C2000WARE
Tool/software:
1:1 I2C Communication
- Master : F280039C
- Slave : AT24C02C
I wrote a code that MCU write total 248 bytes to EEPROM, 8bytes at a time like below.(5ms delay every 8bytes)

But sometimes, MCU made a start condition after the last 8th byte like below.

Below code is what I used in F280039C, could you tell me why MCU makes another start condition after last 8th byte?
uint16_t writeData(struct I2CMsg *msg)
{
uint16_t i;
//
// Setup target address
//
I2C_setSlaveAddress(I2CA_BASE, TARGET_ADDRESS);
//
// Setup number of bytes to send msgBuffer and address
//
I2C_setDataCount(I2CA_BASE, (msg->numBytes + 1));
I2C_putData(I2CA_BASE, msg->memoryAddr);
for (i = 0; i < msg->numBytes; i++)
{
I2C_putData(I2CA_BASE, msg->msgBuffer[i+Blackbox_index]);
}
I2C_setConfig(I2CA_BASE, I2C_MASTER_SEND_MODE);
I2C_sendStartCondition(I2CA_BASE);
I2C_sendStopCondition(I2CA_BASE);
return(SUCCESS);
}







