Write and read the Eeprom ?

zorgloub

Member
Hello Picaxer Community.
What is the difference between DATA / READ and WRITE / READ commands?
Can the DATA or WRITE commands be used indiscriminately to write to the Eeprom with an identical result?

(As for the PEEK/POKE commands, they only allow writing/reading in RAM, with loss of this data when the picaxe is switched off.) Right?
Thank you all
 

Technical

Technical Support
Staff member
Data preloads the eeprom with specific values at download time. read/write are used when the program is running.
 

zorgloub

Member
But it remains of course that the other values written during the execution of the program (with the WRITE command) will also be preserved and usable, in addition to the "preloaded" values thanks to the DATA command, at the next start of the program, even after the power cut?
 
Last edited:

inglewoodpete

Senior Member
But it remains of course that the other values written during the execution of the program (with the WRITE command) will also be preserved and usable, in addition to the "preloaded" values thanks to the DATA command, at the next start of the program, even after the power cut?
The DATA command/directive initialises EEPROM locations at download time. The #NO DATA directive can added to your code to prevent any existing EEPROM data in the chip from being overwritten but allows the original data spec to be preserved in your code file.

The READ and WRITE commands are used in your code to access and overwrite the chip's EEPROM. EEPROM data from a download or WRITE command will remain until overwritten with the next WRITE to that location (or next data dowload where #NO DATA is not included). The latest EEPROM data persists if the chip is powered down.
 

Aries

New Member
the other values written during the execution of the program (with the WRITE command) will also be preserved and usable, in addition to the "preloaded" values thanks to the DATA command, at the next start of the program, even after the power cut?
Really, that is the whole point of EEPROM - that it retains data even when the power is turned off. As has been explained already, DATA loads the EEPROM when the program is first loaded onto the chip. That data can be changed by a WRITE command within the program and the new data is what will then be retained.
 
Top