how to use power down mode of 89S51

In my design,I want to save some parameters when the power is missed.just for about 1hour is enough. The CPU is 89S51.

Because the battery is expensive for our product and the time is as short as 1 hour,I want to use a capacitor.

When 89S51 detect that the power is missing,it will enter to POWER DOWN mode by as insturtion.

But,how to judge the power is missing?only use simple components,such as capacitor,resistor,diode?

Reply to
ehoosee.tianya.cn
Loading thread data ...

This is a fairly simple and common requirement.

I'll assume you mean 'when external power is lost for some amount of time' you want the device to enter powerdown mode to save onboard backup battery life.

One possible solution (of the many available) would be to directly sense the main power on an IO pin (suitably scaled to the IO pin levels of course), and if it is lost, just start counting the time.When you determine (by some internal counter) that the it's time to enter powerdown, then issue the appropriate instructions.

This is possibly the simplest solution in hardware and easily changed because the timing to shutdown is in software.

X-posted to s.e.b. as that's somewhat more appropriate imo.

Cheers

PeteS

Reply to
PeteS

Thanks,all.

In fact,I want to save some parameters of my machine for about one hour. When working under power down mode,the 89S51 need very small current and the data in its RAM is reserved. So the key is how to detect the power is losting.

I have ever heard from some friends that someone can use a diode between VCC of 89S51 and +5V to do that.

"PeteS =D0=B4=B5=C0=A3=BA "

Reply to
ehoosee.tianya.cn

you need to make a brown out detector.. isolate the on board supply (Vcc) with a Diode from the source and use a large cap there which can hold a charge long enough to keep the chip stable. from the same power source before the diode, connect this line to an input. with a pull down resistor. when power is removed from the source, this input will drop low and you should at that time store info you need in EEROM or what ever and then turn off all outputs to make them inputs in area's to make it safe for the control device, then , sit there in a loop for a while monitoring a timer for example. if for example the input line recovers after Xn of seconds. then you can resume operation.

--
"I\'m never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
Reply to
Jamie

So much depends on the input power - is it a clean feed from a regulator? Unregulated? Level? Noise?

All those impact the precise method I would use.

Cheers

PeteS

Reply to
PeteS

Yes.... but you strike me as being a sort of I need to suck your bum sort of person before I get a proper answer and the chances are that the final level of precision you delivered would end up being a piss poor flower arrangement even if you spent a lot of time boasting about it.

DNA

Reply to
Genome

The power to MCU is regulated by a LM7805.

I don't know any other good choice.

As you know,the gap between low level and high level of a MCU is not very precise. So I think it is hard to reach the goal,in fact.

"PeteS =D0=B4=B5=C0=A3=BA "

OWN

kup

nse

ion.

Reply to
ehoosee.tianya.cn

If I told you I spent 12 years in the Royal Navy would it inform you of my proclivities?

;)

Cheers

PeteS

Reply to
PeteS

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.