OK thanks,
meanwhile I have written a Raspberry i2c class from what I have read here and elsewhere and tested it against my EEPROM sample (24LC32A) which I hooked up to the RPi yesterday.
It seems like my byte read/write functions work fine now! Had to weed out a few interpretation bugs while reading the datasheet but once done I can read/write just fine.
So THANK YOU to all contributors!I have yet to make an attempt at read/write a lot of data from the EEPROM in one go.
To do that I have encapsulated the byte read/write functions in a loop for the length of the data.
So I am not using the functions to read sequentially after sending the start byte and address once.
A complete 1-byte read operation as seen on my oscilloscope takes 1.3 ms.
Of this the actual response from the EEPROM when doing a read takes about 0.48 ms.
So it could perhaps be sensible to at least try he sequential read in order to save on the preliminaries for each new byte to read back. If one stores kilobytes of data then it will take time on the order of seconds to read back using the loop...
I might want to test both the loop byte read and the sequential read for speed differences, but as long as the data is not very large it will not matter much.
Regarding i2cdump -y 1 0x50In my case where I have written a few bytes here and there in the EEPROM I expected it to show up but it does not...
Here is what I got:
$ i2cdump -y 1 0x50
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
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: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
40: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
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: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
When I read using my own read function on the written addresses I get this:
Adr Data
05 B4
0F 4B
10 21
4B AA
Reading these locations consistently give the same values with my own i2c debug program.
But with the i2cdump program everything is $FF.
So there is something strange with the i2cdump program...