
Originally Posted by
malc-c
This seems to compile
Code:
for fn = 0 to 3
write (10*fn + 80),lightsetHR[fn]
write (10*fn + 82),lightsetMN[fn]
write (10*fn + 84),lightoffHR[fn]
write (10*fn + 86),lightoffMN[fn]
write (10*fn + 88),word droptemp[fn]
write (10*fn + 90),word normtemp[fn]
write (10*fn + 92),StartHour[fn]
write (10*fn + 94),StartMin[fn]
write (10*fn + 96),StopHour[fn]
write (10*fn + 98),StopMin[fn]
write (10*fn + 100),word alarmhigh[fn]
Write (10*fn + 102),word alarmlow[fn]
next fn
Malcolm,
This code won't work anymore like Alain already mentioned. Now, you have words instead of bytes. Also, now you have 12 variables instead of 10
.
Now, if you try to write 12*2*4=96 bytes at location 80 then you are going to overwrite all the stuff that you wrote at location 150 with your DATA command (from your other post).
I would suggest that you should try first to clear up the mess by organizing the data that you put in EEPROM. It looks like the amount of data that you are putting in memory by doing "Data @0,0 and Data @150" is 58 bytes for each DATA command. So, instead of "Data @0,0 and Data @150" try something like "Data @0,0 and Data @58". Then from location 116 and up you have no data that could get overwritten.
Next, try the same code as above but with the following changes.
Code:
for fn = 0 to 3
write (12*fn + 116),lightsetHR[fn]
write (12*fn + 118),lightsetMN[fn]
write (12*fn + 120),lightoffHR[fn]
write (12*fn + 122),lightoffMN[fn]
write (12*fn + 124),word droptemp[fn]
write (12*fn + 126),word normtemp[fn]
write (12*fn + 128),StartHour[fn]
write (12*fn + 130),StartMin[fn]
write (12*fn + 132),StopHour[fn]
write (12*fn + 134),StopMin[fn]
write (12*fn + 136),word alarmhigh[fn]
write (12*fn + 138),word alarmlow[fn]
next fn
I replaced 10 by 12 since now you have 12 variables. I hope that this helps.
Robert
Bookmarks