I2C: How to adress the second page of a eeprom

i2craspberry pi

I have an eeprom and I can't properly adress everything out of the range 0x00-0x1f.
Using the Raspberry I send the following I2C command to the eeprom:

"sudo i2cset -y 1 0x50 0x00 0x10 0x29"

This command writes the byte 0x29 at the adress 0x10 to the eeprom.
I can than look if it worked by using the command "sudo i2cdump -y 1 0x50 i"

But if I use the same command as above but with a higher second adress value (for example sudo i2cset -y 1 0x50 0x00 0x80 0x29) and then try to look if it worked with i2cdump I don't see any changes. If I change the first byte adress value (for example sudo i2cset -y 1 0x50 0x01 0x10 0x29) then the value change is displayed at 90/0 in the i2cdump output.

Here is an example output of i2cdump so you can better understand what I mean (not my i2cdump output):

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
10: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
20: 8a 8b de bb c9 d8 d0 1d ff ff aa c1 9e c1 9e e3 
30: ba cc a8 d8 b2 ed c2 e4 bb 3c 32 e1 e1 e1 00 00 
40: 01 c3 00 00 00 00 40 50 2d 01 01 40 01 95 00 a3 
50: 10 01 80 ff ff ff 00 00 11 ff ff ff ff ff ff ff 
60: 8a 8b de bb c9 d6 d1 1d ff ff aa c1 9e c1 9e e3 
70: ba cc a8 d8 b2 ed c2 e4 bb 3c 32 e1 e1 e1 00 00 
80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
a0: 8b 8b de bb c8 d9 d1 1d ff ff ab c1 9e c1 9e e3 
b0: ba cc a8 d8 b2 ed c2 e4 bb 3c 32 e1 e1 e1 00 00 
c0: 01 c3 00 00 00 00 40 50 2d 01 01 40 01 95 00 a3 
d0: 10 01 80 ff ff ff 00 00 11 ff ff ff ff ff ff ff 
e0: 8a 8a de bb c9 d8 d1 1d ff ff aa c1 9e c1 9e e3 
f0: ba cc a8 d8 b2 ed c2 e4 bb 3c 32 e1 e1 e1 00 00  

Here's a link to the datasheet from my eeprom, it says a page is 32 byte big, I think that explains why I can`t adress anything bigger than 0x1f. But I don't understand how I can adress the next byte address after 0x1f ?!

Am I interpreting the i2cdump wrong or do I have to use other byte addresses ?

https://cdn-reichelt.de/documents/datenblatt/A300/ST24C32_ST24C64%23STM.pdf

Best Answer

You need to take a closer look at the memory datasheet. Figure 6 on page 7 shows the sequences needed to write to the memory array.

This is not compatible with what the i2cset command is doing. This command assumes that the I2C device is organized as up to 256 8-bit registers, where the register address is the second byte transmitted, and the data to be written is the third byte.

The memory device is not organized in this way. You need to find or write a different command that will send the correct sequences on the I2C bus.