Prevent EEPROM from clearing

vshortt

Senior Member
Do you guys know of a way to prevent the memory in the Picaxe, once loaded with variables using the EEPROM command, to retain the data instead of resetting all the values to zero?

I'd like to be able to store some data in these locations instead of using an external memory chip like the 24LC256

If it's not possible - well, add another couple of parts to the part count....
 

MartinM57

Moderator
The EEPROM command is for loading fixed data into the EEPROM, during a program download, which retains that data even when powered off.

You can save your variables into EEPROM at any time using the WRITE commend (not too many times - a few million or so, and it wears out), or read them back into variables from EEPROM using the READ command at any time you want (and as many times as you want).

Do you want to do anything more than this? - if so, I don't think I'm understanding....
 

hippy

Ex-Staff (retired)
For PICAXE with separate program and data memory you can use the #NO_DATA directive which will leave the Eeprom as it was when a new download takes place, any EEPROM commands are effectively ignored.

For PICAXE with shared memory you cannot use #NO_DATA. Data Eeprom will be zeroed or set to EEPROM command specified values on every download.
 

westaust55

Moderator
In addition to the #no_data directive as mentioned by hippy,

for the X1 and X2 parts there is also the #no_table directive
which will prevent download/overwriting of both EEPROM and table memory.

The PE directives are all covered in PICAXE Manual 2 starting on page 7
 
Last edited:

Hooter

Senior Member
Sorry for the correction Westaust55
'The PE directives are all covered in PICAXE Manual 2 starting on page 7'
 

westaust55

Moderator
yes, You are right.
I meant to type "2" but so close to "1" and the fiendishly flailing finger won :rolleyes:

Sure others will have another view on such a "typo" :D

I will fix above so others read the right reference
 
Top