The 24lc256 has a page size of 64 bytes i am trying to input the values 0 to 63 into the eeprom and then pull them out again into a different array.
Cannot seem to get it right cant read the full 64 bytes the last byte reads 0 or 255 What am i doing wrong here?
Cheers.
ADCON1.3 = 0
ADCON1.2 = 1
ADCON1.1 = 1
ADCON1.0 = 0
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
Define LCD_DREG PORTD
Define LCD_DBIT 0
Define LCD_RSREG PORTE
Define LCD_RSBIT 0
Define LCD_EREG PORTE
Define LCD_EBIT 1
Define LCD_RWREG PORTE
Define LCD_RWBIT 2
COUNTERx var byte[63]
COUNTERy var byte[63]
ADDR VAR WORD
X VAR byte
Y VAR byte
LET ADDR = $0000
for Y = 0 to 63
COUNTERX[Y] = Y
NEXT Y
PAUSE 1000
i2cwrite PORTD.4,PORTD.5,$A000,ADDR,[STR COUNTERX\64]
PAUSE 1000
PAUSE 50
Lcdout $FE,1
LCDOUT "TEST"
LCDOUT $FE,$C2,"TEST"
PAUSE 1000
LET ADDR = $0000
I2CREAD PORTD.4,PORTD.5,$A000,ADDR,[STR COUNTERY\64]
PAUSE 2000
FOR X = 0 TO 63
LCDOUT $FE,1
LCDOUT #COUNTERY[X]
PAUSE 500
NEXT X
end
Bookmarks