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.

Power Good One Shot

Status
Not open for further replies.

JonSea

Well-Known Member
Most Helpful Member
I may be trying to make a simple problem difficult.....

I have a data logger circuit designed to monitor 8 test signals. One of the signals it monitors is the "reset" signal, just after which the unit under test starts a reset process by killing the power supplying my data logger. I'm going to add a supercap to keep the Microcontroller, EEPROM and I2C port expander active long enough to write the status of the monitored lines to EEPROM when the "reset" occurred. After that point, the micro can enter a low power sleep state or even halt program execution until power is restored.

My concern is the unknown state of the supercap when the monitored system is restored to operation and power is restored to my circuit. If the supercap is flat, my PIC18F will get a fresh start and program execution will resume. No problem. If the supercap isn't flat by the time the system is restarted, my PIC won't be reset and it will be stuck in a sleep state.

My first thought is a voltage supervisor chip powered from Vcc, not the supercap. But I don't want this chip is assert a reset as the voltage drops when cut. This is when my PIC needs to record the reset/power fail event.

One solution would be a one-shot triggered when Vcc comes up which would assert a reset to get my PIC going. A 555 circuit could do this. Any other simple approaches come to mind?

As I was typing this, another idea came to mind – a watchdog timer chip powered from Vcc. If my PIC is stuck in never never land, when the watchdog isn't acknowledged, it would assert a reset and get things going.

Any other ideas or specific parts recommendations? Small (but not too tiny) is good, as my board is getting crowded.

Oh, by the way....the PIC is signaled that power has failed by a DS3231 RTC – its /RESET output connected to one of the PICs port pins.
 
the PIC is signaled that power has failed by a DS3231 RTC – its /RESET output connected to one of the PICs port pins
The DS3231 power fail voltage triggers when its VCC = 2.45V-2.7V. I assume that VCC is not the "supercap" VDD running the pic?

It would help to know which pic you're using, and how you're arranging the VCC connections w.r.t. what's powering what.
What about just enabling the pic brown-out reset so that it stops running when the supercap voltage is too low?
 
The picture shows essentially what I'm doing. Vcc powers the RTC (which has its once backup coin cell). The micro, EEPROM, and MCP23017 are powered by MCU Vcc. They literally only need to be powered for seconds to record the sequence of events leading up to the loss of power and the state of the 8 monitored lines until the point power fails. All 3 diodes are Shotkeys.

When the micro, a PIC18F26K22, has finished the above, it can go into a sleep mode. When power fails on this system, I don't know if it's seconds, minutes or even longer before it's restarted. if the supercap is dead (enough), the 18F26k22 will get a clean start when power is restored. On the other hand, if the voltage is holding on the supercap, the 18F26k22 will be stuck in sleep mode. All of Port B is used for data acquisition so I can't use any of those pins to trigger an interrupt condition.

Barring any great ideas, I'm going to use a watchdog timer chip powered by Vcc. If the micro is lost in never never land when Vcc comes back and doesn't toggle the WDT chip, the WDT will reset the 18F26k22 and I'll be back in business.

20170416_052806.jpg
 
The watchdog idea would be my preferred one.
It is simple and low cost, and many companies manufacture them, so you should be able to pick up one that fits your needs.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top