- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. i call the function I2C_M_Start();
2. write a data buf to eeprom:
I2C_M_MasterWriteBuf(SLAVE_ADDR, buf, num, I2C_M_MODE_COMPLETE_XFER);
/* Wait till write operation is complete*/
while (!(I2C_M_MasterStatus() & I2C_M_MSTAT_WR_CMPLT))
{
;
}
//the buf includes the address of eeprom memory.
3. write another data buf to eeprom:
I2C_M_MasterWriteBuf(SLAVE_ADDR, anotherbuf, num1, I2C_M_MODE_COMPLETE_XFER);
/* Wait till write operation is complete*/
while (!(I2C_M_MasterStatus() & I2C_M_MSTAT_WR_CMPLT))
{
;
}
4. i call the function I2C_M_Stopt();
my question :
2 worked 3 did not work
when i commented 2, the 3 woked.
maybe i was wrong about the mode(now is I2C_M_MODE_COMPLETE_XFER).
- Labels:
-
PSoC 5LP