Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to retain a variable value between power cycles...

Status
Not open for further replies.

seemanta

Member level 4
Member level 4
Joined
Jun 10, 2006
Messages
71
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,288
Activity points
1,968
eeprom what is power-cycles

Hi,
I am using 8052 for my own hobby project.
In my project, I need to maintain an array index which will be maintained by the system as long as a power is supplied to it. The index will monotonically increase with time, say for example once a day.

However, after a reset or a power cycle when my program starts to run again, it should "remember" the last value of the index and should continue execution from that point onwards.

Since, I would need to write to this variable, it definitely cannot be in ROM.
Shall I use NVRAM or similar battery backed up memory?

Problem is, I just need a 2 byte wide variable. So for just 2 bytes, is it worth buying a NVRAM memory chip? Please advise.

regards,
Seemanta
 

I think the best solution is a small EEPROM. These parts are good for 100K write cycles per location. Therefore, you need to use a couple of extra bytes. One extra byte is a pointer or offset to the current storage location. This would only change every 100K power cycles and would last through your lifetime. The next extra byte would be a counter of how many times this pointer location was used. This increments with every power cycle. By using these extra bytes the limited write cycle of the EEPROM can be overcome for systems like yours that require only a small amount of saved data.
 

hi,

You can look for some other 8051 vendors in which writing on flash is possible via In Application Programming. P89v51Rd2 is such an example.


With Regards
S.Rajesh Kumar
 

Hi,
You may use 89S8252 having an internal EEPROM if your programmer can program the device, or use a small EEPROM like 93C46 externally.
Regards,
Laktronics
 

hi,

Sorry for over emphasizing. 89v51RD2 does not not need a programmer too .It is programmable from the PC(Via com port) by using Flash Magic software available at free of cost from NXP's website
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top