Hi All,
I am having severe problems trying to get my head around how this chip is working, I know it shouldn't be that hard!!
Eventually I will have two temperature sensor which I wish to record the temp at certain time intervals. After which, I wish to retrieve the data, simply in the terminal window so i can copy that into excel to make graphs. However, to make it easy i am starting with two potentiometers (i don't have the temp sensors yet and i wanted to see how to use memory)
My problem is writing to the EEPROM, here is what I think is right (but obviously wrong as it doesn't work):
So i want to record data in two different addresses. The high 2 and low 2 is merely an LED i have on the board to show me it is doing something.
Then to read it back I have:
All i am getting back is that Temp1 is the same as Temp2, seeing as I am turning the pots round at different times, this certainly is not true!!
I think the problem is that i am not sure how to address which byte i want to write to, so everything is getting muddled in my head.
Any help would be very much appreciated!
I am having severe problems trying to get my head around how this chip is working, I know it shouldn't be that hard!!
Eventually I will have two temperature sensor which I wish to record the temp at certain time intervals. After which, I wish to retrieve the data, simply in the terminal window so i can copy that into excel to make graphs. However, to make it easy i am starting with two potentiometers (i don't have the temp sensors yet and i wanted to see how to use memory)
My problem is writing to the EEPROM, here is what I think is right (but obviously wrong as it doesn't work):
Code:
for b3 = 0 to 59
high 2
readadc 0,b0
readadc 1,b1
i2cslave %10100000, i2cfast ,i2cword
writei2c b3, (b0)
pause 10
b4 = b3 +1
writei2c b4, (b1)
pause 100
low 2
pause 100
next b3
Then to read it back I have:
Code:
for b3 = 0 to 59
i2cslave %10100000, i2cfast ,i2cword
readi2c b3, (b0)
b4 = b3 +1
readi2c b4, (b1)
sertxd("Temp1 = ", #b0,13,10)
sertxd("Temp2 = ", #b1,13,10)
pause 200
next b3
I think the problem is that i am not sure how to address which byte i want to write to, so everything is getting muddled in my head.
Any help would be very much appreciated!