Tom,
your code works as designed.
In the FOR...NEXT loop to write the eeprom you are counting from 0 to 640.
X is a WORD size variable and being used as EEPROM address as well as value to be written.
This means you are writing a WORD (two BYTES) to the EEPROM.
This requires two BYTE locations in your EEPROM.
By incrementing the address counter by 1 the LowByte of the last WORD written will always be overwritten with the HighByte oft the current WORD.
here is a working example:
Code:
for X = 0 to 640
I2Cwrite SDA, SCL,ROM,X*2,[x]
pause 10
Serout2 portout, mode, ["Write Address: ",#x*2," Data:",#x,10,13]
dta=dta+1
next x
for x = 0 to 640
I2Cread SDA,SCL,ROM,X*2,[dta]
Serout2 portout, mode, ["Address: ",#x*2," Data:",#dta,10,13]
pause 100
next x
Bookmarks