Content originally posted in LPCWare by madhu kumar on Wed Dec 02 21:30:05 MST 2015
hi,
i have connected external eeprom (AT24C02D) device to i2c2 in lpc1769 and SDA line connected to P0.10, SCL line connected to P0.11
then we write 10 bytes data to eeprom and readback is not working. result as shows below following line
**************** I2C Demo Menu ****************
0: Exit Demo
1: Select I2C peripheral [I2C2]
2: Toggle mode POLLING/INTERRUPT [INTERRUPT]
3: Probe for Slave devices
4: Read slave data
5: Write slave data
6: Write/Read slave data
1
Select I2C device [0 or 1 or 2] : 2
0: Exit Demo
1: Select I2C peripheral [I2C2]
2: Toggle mode POLLING/INTERRUPT [INTERRUPT]
3: Probe for Slave devices
4: Read slave data
5: Write slave data
6: Write/Read slave data
Select an option [0 - 6] :5
Enter 7-Bit Slave address : 0x50
Enter number of bytes to write : 10
1:Enter Data: 0xaa
2:Enter Data: 0xbb
3:Enter Data: 0x11
4:Enter Data: 0xcc
5:Enter Data: 0x22
6:Enter Data: 0x33
7:Enter Data: 0x44
8:Enter Data: 0x55
9:Enter Data: 0x66
10:Enter Data: 0x77
Written 10 bytes of data to slave 0x50.
**************** I2C Demo Menu ****************
0: Exit Demo
1: Select I2C peripheral [I2C2]
2: Toggle mode POLLING/INTERRUPT [INTERRUPT]
3: Probe for Slave devices
4: Read slave data
5: Write slave data
6: Write/Read slave data
Select an option [0 - 6] :4
Enter 7-Bit Slave address : 0x50
Enter number of bytes to read : 15
Read 15 bytes of data from slave 0x50.
*xfer.rxBuff : 11
*xfer.rxBuff : cc
*xfer.rxBuff : 22
*xfer.rxBuff : 33
*xfer.rxBuff : 44
*xfer.rxBuff : 55
*xfer.rxBuff : ff
*xfer.rxBuff : ff
*xfer.rxBuff : ff
*xfer.rxBuff : ff
*xfer.rxBuff : ff
*xfer.rxBuff : ff
*xfer.rxBuff : ff
*xfer.rxBuff : ff
*xfer.rxBuff : ff
00: 11 CC 22 33 44 55 ff ff 00 00 00 00 00
**************** I2C Demo Menu ****************
0: Exit Demo
1: Select I2C peripheral [I2C2]
2: Toggle mode POLLING/INTERRUPT [INTERRUPT]
3: Probe for Slave devices
4: Read slave data
5: Write slave data
6: Write/Read slave data
Select an option [0 - 6] :
so write data and read data not matching or not syncing please tell me suggestion me.