ADVERTISEMENT
You will be redirected to your destination in 20 seconds.
Subscribe to EDN
RSS
Reprints/License
Print
Email

Algorithm keeps data safe

Prevent data loss against power blackouts and other interruptions.

Luis G Uribe C, Caracas, Venezuela; Edited by Martin Rowe and Fran Granville -- EDN, January 21, 2010

PDF

Many embedded systems must regularly update multibyte data to EEPROM, flash memory, or a database server. This Design Idea presents a robust algorithm for this process that prevents data losses and inconsistencies due to program interruptions or power failures. You can avoid data losses by maintaining two separate memory areas, duplicating critical variables in each. Memory can be battery-backed RAM, magnetic disks, flash memory, or local or remote storage subsystems. You can use a simple FSM (finite-state machine) that uses three or four states with appropriate Gray coding to track the status of each main variable and its mirrored value in the storage devices. The states run in a sequence that the software driver can use to write data to both the main and the backup variables. The driver sets and resets two variables, B0 and B1, as status bits. B0 is the main variable status bit, and B1 is a mirror status bit. Both bits are recorded in the same storage medium as the data.

See all of EDN's
Design Ideas

This algorithm prevents race conditions and ambiguous situations. You can enter the power-up verification routine at any time, interrupting the main flow of the program without losing any data. Figure 1 shows the flow of the algorithm, which begins with a power-up routine. Table 1 identifies and defines each of the possible states for the variables. Click here for other algorithms.

RSS
Reprints/License
Print
Email
Canon Resource Center

Featured Company


Most Recent Resources

Advertisement
Related Content

No related content found.

  • 0 rated items found.
Advertisement

KNOWLEDGE CENTER

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
Featured Job On
Scroll for More Jobs
Advertisement
About EDN   |   Site Map   |   Contact Us   |   Subscription   |   RSS
© 2012 UBM Electronics. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other UBM Canon sites

UBM Canon | Design News | Test & Measurement World | Packaging Digest | EDN | Qmed | Pharmalive | Appliance Magazine | Plastics Today | Powder Bulk Solids | Canon Trade Shows