eeprom adresses for data - howto?

KTarke

Senior Member
I am working on some control devices, powered by mains only.
NEED to retrieve a few bytes (1-5) of data after a mains down. (so that program could continue from "where it left", and to storage "user settings")

When got in programming to the state, where that was needed, I was surprised, what I found from manual:
-EEPROM -command only exepts CONSTANTS, not the contain of a variable
-POKE only reaches RAM

Is there any way to store a few bytes so, that they are available after reset?

Picaxe is 28X2 (there is places even for several programs, but manual tells no more. It's odd, if there is no access to eeprom)

Suggestions?

I would not like to use a ni-mh backup, because it is not maintenace free (and takes room)
External I2C eeprom could be possible, if there is no "software" solution.
 

hippy

Technical Support
Staff member
WRITE ( and READ ) is what you're after.

EEPROM pre-loads the data eeprom on download ( assuming no #No_Data ), WRITE updates it at run-time.
 

KTarke

Senior Member
WRITE ( and READ ) is what you're after.

EEPROM pre-loads the data eeprom on download ( assuming no #No_Data ), WRITE updates it at run-time.
Thank You, Hippy, again, for good advice!
Sorry ,that I asked a obvious one, just didn't find the right answer myself.
 

MPep

Senior Member
As you require this info to be written after Mains Power down, I take it that you have a large enough capacitor to keep the DC supply going just long enough to to actually write to EEPROM?
 

KTarke

Senior Member
As you require this info to be written after Mains Power down, I take it that you have a large enough capacitor to keep the DC supply going just long enough to to actually write to EEPROM?
Not a very large cap, but I was thinking updating regulary.
"Earlier" values are also good enough (does not have to be from the last uS before mains down)

I think, that eeprom should be updated "by action" :
-user settings stored, when done (set by pressing buttons)
-"base" to adjusting-values ,every time after measurement+mathematical processing is done (OR periodically, if update is too often to reach the maximum write-times too soon) Have to consider that,regarding to application.

Main thing is having a "real" starting point from which to continue, rather than trusting on pre-set "init"-values which could cause odd behaviour (in environments , which the programmer hadn't thought about)

AND it could take some time, before the user even notices, that his settings have been "annulled" by a mains down... (this is usual, have noticed it with the use of products I resell in my job)
 

papaof2

Senior Member
AND it could take some time, before the user even notices, that his settings have been "annulled" by a mains down... (this is usual, have noticed it with the use of products I resell in my job)
If the PICAXE is aware of a power fail/restore (sometimes called an "Edison reset" ;-), then the device could include an indicator of some type to notify the user.

There is a limit to the number of times EEPROM can be written, but user settings are usually not a concern because they are not changed frequently. The number of writes depends on the type of EEPROM. There was some testing done by a forum member (maybe last year?). Search for
eeprom wear
or
write endurance

There was a recent post about datasheet info for some specific PICAXE chips:
http://www.picaxeforum.co.uk/showthread.php?t=12929

John
 

KTarke

Senior Member
If the PICAXE is aware of a power fail/restore (sometimes called an "Edison reset" ;-), then the device could include an indicator of some type to notify the user.

There is a limit to the number of times EEPROM can be written, but user settings are usually not a concern because they are not changed frequently. The number of writes depends on the type of EEPROM. There was some testing done by a forum member (maybe last year?). Search for
eeprom wear
or
write endurance

There was a recent post about datasheet info for some specific PICAXE chips:
http://www.picaxeforum.co.uk/showthread.php?t=12929

John
Inreresting link!

I had seen only that 100K writes - figure, and thought, that it is the same with all Pic's.
In my application, the 28x2 is 5V, and I have 10 times more writes...nothing to worry about.
Have to consider carefully the write-period (of changing values), the gadget should last some years atleast, without processor switch. Processor is not expensive, and is easy to switch, but any concequences of memory-wear-out should not occur within 2 years, else user considers the device unreliable, and that is a matter of honour for the builder:)
 

papaof2

Senior Member
You need the MicroChip datasheet for the chip used for the PICAXE of interest, as it will have the details on the EEPROM in that chip. Some are good for a million writes, others for only 10000 or so - and the same chip may have more than one type of EEPROM on it...

John
 

Dippy

Moderator
PICs with 2 different EEPROM types onboard? Really?
I'm interested.
Or are you talking about the EEPROMs with the High Endurance block?

Most things (and Errata sheets) were generally discussed in that other thread.

Here's an interesting bit of Microchip marketing...
 
Top