Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

how to save data on power failure

Status
Not open for further replies.

garg29

New Member
hi friends,
i'm making a counter using 89c51 & 7-segment displays. i want to save the last value in eeprom on a power failure. i have the write routines required to write to eeprom but i don't no how to create an interrupt on power failue. my idea is to have a big condensor 2200 uC and use it's power, on power failure, to write to eeprom. i'm using 24c02 eeprom.

Thanks a lot.

Amit
 
garg29 said:
hi friends,
i'm making a counter using 89c51 & 7-segment displays. i want to save the last value in eeprom on a power failure. i have the write routines required to write to eeprom but i don't no how to create an interrupt on power failue. my idea is to have a big condensor 2200 uC and use it's power, on power failure, to write to eeprom. i'm using 24c02 eeprom.

Feed the power to the 2200uF through a diode, monitor the input side of the diode to detect power failure - when the power goes low there, initiate the EEPROM write routine, either via an interrupt or polling, it should be possible on the stored energy in the capacitor.
 
thanks a lot for replying. i tried this. i connected the pin 3.2 of 89c51 which is external interrupt pin, to input side of the diode, but this didn't work. do i need to put some extra resistor or anything else on p3.2 pin to make it logic 0 on power failure. i think it's not deecting the external interrupt.
thanks once again
 
garg29 said:
thanks a lot for replying. i tried this. i connected the pin 3.2 of 89c51 which is external interrupt pin, to input side of the diode, but this didn't work. do i need to put some extra resistor or anything else on p3.2 pin to make it logic 0 on power failure. i think it's not deecting the external interrupt.
thanks once again

I'm presuming this pin will detect a negative going signal?, it may help to have a resistor down to 0V from the input side of the diode.

In order to make it respond faster you could use a comparator, and set it to switch at a higher voltage than a logic input does. Assuming this device has a PSU regulator?, monitor the power BEFORE the regulators reservoir capacitor, using the same diode technique - this would give you even more time!.
 
thanks again for replying. but sorry for bothering you again. i tried the resistor one also but this is not working. i don't want to use the comparator as i want to keep the cost lowest.
thanks
 
I think you're going the wrong way. Powering down is a generally unreliable time to be doing things, even with a large cap. EEPROM doesn't always write correctly when the voltage is low.

You should NOT feed this through a diode like this. This puts the input voltage 0.7V above the supply voltage. I'm not familiar with your part but usually protection diodes will kick in at 0.3V and all the system's power will try to flow in through that pin! So you'd want to put two diodes in parallel (so it can pull the voltage both up and down) between the source and the pin.

What I'm getting at is why not just write the EEPROM periodically. Then the value will always be available. Now they do have a limited number of writes, but it's a really high number. If you only update it every second or seconds it would take decades to even hit the rated limit.
 
thanks everyone for replying. i tried out with a condensor of 2200 uF and diode and it worked out. but the problem is sometimes on power up the data latches up.......can you guys please help me out...thanks
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top