Searching \ for '[PIC] Save data to EEPROM on power failure or not.' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/memory.htm?key=data
Search entire site for: 'Save data to EEPROM on power failure or not.'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Save data to EEPROM on power failure or not.'
2005\10\09@155732 by Sam

picon face
Could anybody advise me which is better solution:



1)       To put battery on board and put additional circuit for putting PIC
into sleep mode after it detects power failure



Or



2)       Design some sort of circuit that would store data in PIC's EEPROM
after power failure. I assume you would have to put some capacitor to store
enough power for PIC to save data to EEPROM. Am I right?





Thank you,

Sam



2005\10\09@170634 by Jose Da Silva

flavicon
face
On October 9, 2005 12:58 pm, Sam wrote:
> Could anybody advise me which is better solution:
>
> 1)       To put battery on board and put additional circuit for
> putting PIC into sleep mode after it detects power failure
>
> Or
>
> 2)       Design some sort of circuit that would store data in PIC's
> EEPROM after power failure. I assume you would have to put some
> capacitor to store enough power for PIC to save data to EEPROM. Am I
> right?

Only you can really answer this question, but.
Batteries add component count, so more circuitry, more cost, more
weight, more to test, and more components that can possibly go wrong.
If it is supposed to be portable, you might not appreciate the extra
weight, plus batteries bring in their own problems, such as
maintainance. some batteries leak below a threshold voltage, and some
batteries such as Lead-acid or Nicad leak power so must constantly be
"topped-up",  If the battery is placed close to a heat source, they can
dry-up if it's long term, but then again I've also replaced dried-out
capacitors too.

On the other hand for the eeprom solution, it's already built into the
PIC and the capacitor only need supply the PIC and nothing else, so how
many uF do you need to supply 2mA for 10...100mSec?

Hope this helps.

2005\10\09@173053 by Harold Hallikainen

face picon face
The ideal design (no parts, or, at least, no additional parts) seems to be
to use the low voltage detector in the PIC to generate an interrupt and
save stuff away to eeprom as the power supply dies. The question is
whether the power supply voltage falls slowly enough to do what needs to
be done. I've done this in a couple products to save away a few bytes.

Harold

--
FCC Rules Updated Daily at http://www.hallikainen.com

2005\10\09@181152 by Maarten Hofman

face picon face
> The ideal design (no parts, or, at least, no additional parts) seems to be
> to use the low voltage detector in the PIC to generate an interrupt and
> save stuff away to eeprom as the power supply dies. The question is
> whether the power supply voltage falls slowly enough to do what needs to
> be done. I've done this in a couple products to save away a few bytes.


Also note that writing data to the EEPROM is one of the more power intensive
tasks on most PICmicros. As far as I know it involves a charge pump to get
the voltage needed to write to EEPROM as well as circuitry that is usually
not active. When I did tests at lower levels I noticed that writing to the
EEPROM is something that can actually cause brown outs.

Greetings,
Maarten Hofman.

2005\10\10@002620 by Chen Xiao Fan

face
flavicon
face
The problem is that often the capacitors will not only
supply to the PIC. It is often connected to other components
and thus will supply current to other part of the circuits
as well so it will not be only 2mA for 10...100ms.

So a batery-backup or supercapacitor-backup circuit (or
better a UPS for bigger equipment) may still be necessary.
But I agree with you that battery is very problematic
for quite some industrial equpement in the certification
process. I am not so sure about supercapacitors.

EEPROM data corruption is a big problem for configuration data
teach-in process for our optic sensors. During the teach-in
process, the EEPROM data will be updated so that the new
configuration will be functional after the teach-in. However
if power breaks down during the process, the configuration
data will be corrupted. The solution is to have two
sets of configuration data and do a sanity check of the
first set of configuration data. If it is broken, then
the second set (last known-good or the baseline configuration)
will take over.

And power failure is difficult to handle in gereral for
small sensors or sensor interface cards. EN61000-4
(Or IEC61000-4) voltage variation/interruption may be an
applicable standard. For example, to fullfil NAMUR NE21 standards
for the chmeical industry requires sensor to fully working
with a 20ms supply interruption. The sensot will also need
to work after 40% or 100% voltage reduction (reset to
normal working condition when power recovers).
Often a big capacitor will be needed supply the 20ms
supply interruption and some careful design will be
reuired to fullful the voltage variation.

Regards,
Xiaofan

{Original Message removed}

2005\10\10@005646 by Jinx

face picon face

> The problem is that often the capacitors will not only
> supply to the PIC. It is often connected to other components
> and thus will supply current to other part of the circuits
> as well so it will not be only 2mA for 10...100ms.

You can isolate the PIC and cap from each other with a
Schottky diode (2 if using a battery that's less than Vcc).
If the PIC can't run with a diode drop in its supply, then
the supply can be jacked up (eg 7805 + diode) to
compensate

2005\10\10@012424 by Chen Xiao Fan

face
flavicon
face
How do you isolate the PIC Vcc from the rest of the
circuits if Vcc is conected to other part of the circuit?
For example this Vcc (say 5V) is often connected to
a green indicator LED which consumes 2mA.

How do you charge the backup capacitor?

I think it will take more than a Schottky diode to
achieve the isolation of PIC Vcc supply.

Regards,
Xiaofan

{Original Message removed}

2005\10\10@033504 by Jinx

face picon face
> How do you charge the backup capacitor?
>
> I think it will take more than a Schottky diode to
> achieve the isolation of PIC Vcc supply.

It's similar to the situation when you have a noisy
component like a relay coil or solenoid. You split the
supply with a pair of diodes so that the noisy component
and PIC each have their own V+, individually filtered,
separated from each other by a reverse-biased diode

For the Subject specifically you want to have a local
backup supply just for the PIC

k goes to PIC Vcc and a to the circuit V+. The back-up
component (C or battery) is across the PIC's Vcc and Vdd.
If a C, then it will charge via Vcc. If it's a battery with V <
Vcc then connect B- to Vdd and B+ to Vcc through a diode,
a to B+, k to Vcc. This stops Vcc over-charging / stressing
the battery. The only proviso to having a large C across the
PIC is that at power-up it may cause Vcc to rise too slowly.
If that were to be a problem then the POR function of the
PIC could be used

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...