I've searched but "read" or "write" as terms bring up most of the posts on the forum. >_<
Manual 2, page 184:
Now for future downloads, I comment out the write commands, and download and test program changes. I understand that the "reserved" bytes hold their value across power ups, the same as the main program. But will they survive repeated downloads, where the main program body doesn't "touch" them?
I'd hate to have the init code run every power up, that would be unnecessary. I'd like to set them, then re-download the same program with the writes commented out. I think that's possible, if I understand the bolded portion of the manual quote above.
Any help is appreciated, thanks.
Manual 2, page 184:
Supposing I want to "set aside" the last 6 bytes (250 to 255) by making sure the program is 249 bytes or less. Then my program has the write command in the init section which fills those values. I then power up the chip and the program runs once, setting the values. Sample code:The write command allows byte data to be written into the microcontrollers data memory. The contents of this memory is not lost when the power is removed. However the data is updated (with the EEPROM command specified data) upon a new download. To read the data during a program use the read command.
With the PICAXE-08, 08M, 14M and 18 the data memory is shared with program memory. Therefore only unused bytes may be used within a program. To establish the length of the program use ‘Check Syntax’ from the PICAXE menu. This will report the length of program. Available data addresses can then be used as follows:
PICAXE-08, 18 0 to (127 - number of used bytes)
PICAXE-08M, 14M, 20M 0 to (255 - number of used bytes)
Code:
init:
write 250, "a"
write 251, "b"
write 252, "c"
write 253, "d"
write 254, "e"
write 255, "f"
main:
.... 'main program body
I'd hate to have the init code run every power up, that would be unnecessary. I'd like to set them, then re-download the same program with the writes commented out. I think that's possible, if I understand the bolded portion of the manual quote above.
Any help is appreciated, thanks.