Writing to eeprom memory inside a picaxe

@lowa

New Member
Hi everybody
Is it possible to write to the non volatile memory from inside a program on a 18x so the written value(s) will still be there after the power is tunned off and on again

Thanks

@lowa
 

testerrrs

New Member
Yes. Have a look at the 'read' and 'write' commands in the BASIC manual. How much available memory you have will depend on program size and/or variety of PICAXE.

*j
 

crossthreaded

New Member
Yes the 18x eeprom can be accessed using read and write commands and, yes, it will retain the data during a power cycle. However, when you download software to the picaxe, it clears the eeprom.

If you want to maintain the eeprom values during a software update I think you have to have a routine to upload the eeprom values so that you can restore them after (or during) the next software download.
 

@lowa

New Member
Yes the 18x eeprom can be accessed using read and write commands and, yes, it will retain the data during a power cycle. However, when you download software to the picaxe, it clears the eeprom.

If you want to maintain the eeprom values during a software update I think you have to have a routine to upload the eeprom values so that you can restore them after (or during) the next software download.
Thank you for your reply.
What is the instruction name to put data in the eeprom during a software download

@lowa
 

@lowa

New Member
Is the eeprom instruction only executed on software download or will it been executed every time I power the chip aferward?

@lowa
 

BCJKiwi

Senior Member
It's in the program on the chip so will execute every time the program passes the line.

So if it's at the top BEFORE your Main: loop, then it will only execute once at power up.

If it is in the body of the program somewhere then it will re-write to the eeprom every time the program hits the line.

Remember eeprom has a finite number of writes so it is recommended to use it in the once per power up mode.
For RAM type storage on 18X (no write limits), see Manual2 page12
 

westaust55

Moderator
The EEPROM command is a Programming Editor control not a BASIC instruction that is not run by the program within the PICAXE.

It is used to a method of pre-loading the microcontrollers data memory only at the time a program is downloaded. If no EEPROM command is used the values are automatically cleared to the value 0.
 

westaust55

Moderator
as geforce has stated, you must use the READ and WRITE commands to read data from EEPROM or write data to EEPROM within a running program.
 

BrendanP

Senior Member
Another option is to use external eeprom, that will give you plenty of storage room and it wont be affected by program downloads into the picaxe.
 

@lowa

New Member
Thanks Westaust55
This is exactly want i want to do.
This is very clear in the description of the eeprom instruction.
i can go back to programmation

@lowa
 
Top