Normally you'd want to have the output enabled, and a little bit of hysteresis applied to give more reliable triggering.
A bit of searching about comparators would give a lot of data.
What is the load current on your 5v supply?. As I said earlier, this 'defines' the time you have available.
How much data are you trying to write?. This defines how long you need.
Best Wishes
jaikumar
Joined: 15 Dec 2006 Posts: 109
Posted: Mon Aug 12, 2013 10:58 am
current 80mA,
I found with the scope the voltage stays above 4.50V for about 0.5 sec.
There is another question i want to ask.
Example.
Code:
While(1)
{
If (input(power_status)=0) { savevar();} // gets here every 1m sec
code // no blocking code
·
·
·
code
}
If in the above code i have 0.5 sec after power off and i get to the polling power status code every 0.5 sec then the savevar function will for sure get executed right?
Regards,
Jai.
Ttelmah
Joined: 11 Mar 2010 Posts: 20161
Posted: Mon Aug 12, 2013 12:23 pm
You most certainly do _not_ want to be repeating the writing.
You must _not_ be writing to the EEPROM when the power actually fails. This can corrupt the EEPROM.
The sequence should be:
If (fail detected)
write data once
wait for more than the best case that the supply might keep going
If (power has not gone off)
restart
Again the question. How much data are you writing?.
All times are GMT - 6 Hours Goto page Previous1, 2
Page 2 of 2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum