Shop OBEX P1 Docs P2 Docs Learn Events
user data protection for power failure — Parallax Forums

user data protection for power failure

AHMET AKSUAHMET AKSU Posts: 62
edited 2007-05-07 17:23 in Propeller 1
·


·· what is the most suitable way to save user data when power failed. I think the software side of this work must be to save user data
·on eeprom land not used by propeller.I need a circuit which know power failed and says to·propeller "save user data power goes out"
also this circuit·turn on·battery power to supply enough time to propeller to save data.is maxim max807 suitable for this project

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-07 12:28
    The Propeller is capable of measuring its own power supply voltage with just an external resistor and capacitor. The AN001 application note discusses analog to digital conversion and there are examples in the sample programs included with the Propeller Tool. In terms of battery power, it's usually best to use an automatic changeover mechanism like connecting the battery backup and the main supply each through a diode to a common point like the input to your 3.3V regulator.

    If you use a Protoboard, you'd have at least 32K bytes of EEPROM available for saving user data. If you build your own, be sure to use either a 24LC512 EEPROM or a 24C1024 EEPROM (used on the Hydra) rather than the 24LC256 usually used. There are two sets of routines in the Propeller Object Exchange that can be used to access the EEPROM. I suggest the one labelled "Basic I2C Driver". There are examples of its use in the source.

    The amount of time you'd need to power the Propeller depends on how much data you'd have to store and on your main program and how long it would take to reach a "check point" where the data to be saved is at a stable point (not in the middle of a computation or partial update). The EEPROMs can write about 128 bytes in a 10ms cycle.

    Another alternative would be to use a separate Ramtron FRAM. These work like EEPROMs, but have essentially unlimited write cycles and don't have the 10ms write cycle. Your program could possibly write its data to the FRAM as it is received (or computed) and you wouldn't need a separate backup. During a power outage, your program would simple stop without needing to separately save its last set of data. The FRAM could be attached to the same I/O pins as the boot EEPROM.
  • AHMET AKSUAHMET AKSU Posts: 62
    edited 2007-05-07 16:00
    many thanks for your reply Mr Mike Green . I m actualy using 24lc512 and "basic i2c driver" .when a pulse abaut power failed my project writing user values
    to eeprom too.but the problem is on harware side .Propeller needs time to make this works.How can I add super capacitor or chargable power to my sytem.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-07 17:23
    Attached is a datasheet for a typical backup battery controller that can charge a NiMH cell and use it to deliver regulated +5V or +3.3V when the main power supply fails. You could "float" a super capacitor across the 5V regulated supply. If you use a 5V regulator that's protected from reverse current (alternative supply for output, no input or shorted input terminals), you won't need a series diode to protect the super capacitor from discharging through the regulator. Using the super capacitor across the 5V supply gives a little "head room" before the +3.3V supply starts to sag.
Sign In or Register to comment.