1

I am interfacing with 24LC512 and 47C16 EEProm/EERam

I have stored multiple bytes starting at location 0 on both chips.

on the 24LC512 I get these results - notice when I execute a block read using bus.read_i2c_block_data, it starts with the 2nd memory location. When I reset the pointer back to 0 and read with bus.read_byte, it reads the location at 0 and correctly increments the pointer by 1

>>> bus.write_byte_data(0x54, 0, 0)
>>> bus.read_byte(0x54)
45
>>> bus.write_byte_data(0x54, 0, 0)
>>> bus.read_i2c_block_data(0x54, 0, 6)
[46, 71, 65, 32, 48, 255]
>>> bus.write_byte_data(0x54, 0, 0)
>>> bus.read_byte(0x54)
45
>>> bus.read_byte(0x54)
46
>>> bus.read_byte(0x54)
71
>>> bus.read_byte(0x54)
65
>>> bus.read_byte(0x54)
32
>>> bus.read_byte(0x54)
48

I get the same results on the 47C16

>>> bus.write_byte_data(0x50, 0, 0)
>>> bus.read_i2c_block_data(0x50, 0, 6)
[46, 71, 70, 32, 49, 255]
>>> bus.write_byte_data(0x50, 0, 0)
>>> bus.read_byte(0x50)
45
>>> 
>>> bus.read_byte(0x50)
46
>>> bus.read_byte(0x50)
71
>>> bus.read_byte(0x50)
70
>>> bus.read_byte(0x50)
32
>>> bus.read_byte(0x50)
49

It appears I am not using the read_i2c_block_data correctly - even though this is what I read in the documentation. What am I doing wrong ??

thank you for any pointers you can provide

Kurt
  • 35
  • 4

0 Answers0