eeprom through i2c

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

eeprom through i2c

369 Views
lpcware
NXP Employee
NXP Employee
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.




Labels (1)
0 Kudos
2 Replies

308 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by madhu kumar on Thu Dec 03 02:26:43 MST 2015

hello  R2D2


**************** 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] :3
Probing available I2C devices...

     00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
====================================================
00                           -- -- -- -- -- -- -- --
01   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
02   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
03   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
04   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
05   50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
06   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
07   -- -- -- -- -- -- -- -- --

0x50 is the eeprom device slave address so eeprom device is detected but how to write of eeprom device(AT24C02D)

i write first 2 bytes write

Enter 7-Bit Slave address : 0x50
Enter number of bytes to write : 4
1:Enter Data: 0
0
2:Enter Data: 8
8
3:Enter Data: 0x11
0x11
4:Enter Data: 0x22
0x22

but eeprom read back is not working, please tell me 


0 Kudos

308 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Dec 02 21:40:18 MST 2015

Quote: madhu kumar
please tell me suggestion me.



:quest:

Read EEPROM datasheet and learn how write / read is working...

Use Forum Search to find solutions:

See. https://www.lpcware.com/content/forum/lpc1769-i2c-not-working
0 Kudos