Posted on July 16, 2013 at 10:12I2C_GenerateStart(ENABLE);
while(!I2C_CheckEvent(I2C_EVENT_MASTER_MODE_SELECT));
/* Send EEPROM address for write */
I2C_Send7bitAddress(0x70, I2C_DIRECTION_TX);
/* Test on EV6 and clear it */
while(!I2C_CheckEvent(I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED ));
I2C_ClearFlag(I2C_FLAG_ADDRESSSENTMATCHED);
/* Send Address (on 2 bytes) of first byte to be written & wait event detection */
I2C_SendData(0xC8); /* MSB */
/* Test on EV8 and clear it */
while (!I2C_CheckEvent(I2C_EVENT_MASTER_BYTE_TRANSMITTING));
I2C_SendData(0xaa); /* LSB */
/* Test on EV8 and clear it */
while (!I2C_CheckEvent(I2C_EVENT_MASTER_BYTE_TRANSMITTING));//////Stuck here my code
I2C_GenerateStop(ENABLE);