With some great help I have managed to get my clock data writing at regular intervals to the eeprom chip. However I seem to have a bug, the increments for the write address go up in tens (for ease of tracking / recovering the data), everything is fine up until address location 60 after which the next write address jumps to 2059. I have erased the eeprom and re-uploaded the programme, and occasionally it will run as expected but mostly jumps from 60 to 2059.
Any help (you've been great already) would be much appreciated.
Si.
Code:-
main:
high 0
pause 150
i2cslave %10100000, i2cfast, i2cword 'initialise eeprom
readi2c 0,(b0,b1) 'read loc 0
pause 50
w4=w0+10 'increment address by 10
writei2c 0,(b8,b9) 'write new location w4 to location 0 on eeprom
low 0
pause 100
goto clock
end
clock:
i2cslave %11010000, i2cslow, i2cbyte 'inialise clock
readi2c 0,(b0,b1,b2,b3,b4,b5,b6) 'read clock
pause 100
i2cslave %10100000, i2cfast, i2cword 'initialise eeprom
writei2c w4,(b0,b1,b2,b3,b4,b5,b6) 'write clock data to eeprom at location w4
pause 10
sertxd (#w4," ",#b0,#b1,#b2,#b3,#b4,#b5,#b6,13,10)'output data to serial port to check
pause 50
Any help (you've been great already) would be much appreciated.
Si.
Code:-
main:
high 0
pause 150
i2cslave %10100000, i2cfast, i2cword 'initialise eeprom
readi2c 0,(b0,b1) 'read loc 0
pause 50
w4=w0+10 'increment address by 10
writei2c 0,(b8,b9) 'write new location w4 to location 0 on eeprom
low 0
pause 100
goto clock
end
clock:
i2cslave %11010000, i2cslow, i2cbyte 'inialise clock
readi2c 0,(b0,b1,b2,b3,b4,b5,b6) 'read clock
pause 100
i2cslave %10100000, i2cfast, i2cword 'initialise eeprom
writei2c w4,(b0,b1,b2,b3,b4,b5,b6) 'write clock data to eeprom at location w4
pause 10
sertxd (#w4," ",#b0,#b1,#b2,#b3,#b4,#b5,#b6,13,10)'output data to serial port to check
pause 50