12cwrite not working with 24LC08 SEEPROM ??
I'm trying to fill a SEEPROM with a data lookup table so I can read it later. I'm using a 24LC08 and writing a series of word constants to it. As a test I'm just using a loop to write a sequence of numbers equivalent to the addresses, but that is not working. The loop tries to write values 0-20 to locations 0-20 (actually 0-40 for word vars) but it's only writing the 1st 3 bytes in the EEPROM.
I can take the LC08 out of the circuit and read it with a prom burner to verify the results and it verifies that all I'm writing is the 1st 3 bytes - and those values do not reflect what I'm trying to write.
Here's my code loop:
for temp = 0 to 20
i2cwrite eedat,eeclk,$A0,Temp,[temp] ' write
pause 400 ' hold for display
i2cread eedat,eeclk,$A0,temp,[Mode] ' read it back
lcdout lcdcmd,lcdline2,#temp," ",#Mode ' display it
pulsout piezo,10 ' diagnostic "tic" sound
next temp
My LCD shows reads of 0 (zero), but the chip reads as:
10 00 10 FF FF FF FF...
I'm really frustrated, nothing is adding up here. Am I doing something dumb?
"Do or do not, there is no try" Yoda
Bookmarks