Mic ro p ro c e s s o r S u p e rvis o ry Circ u it
MAX791
Wa t c h d o g S o ft w a re Co n s id e ra t io n s
A way to help the watchdog timer keep a closer watch
on software execution involves setting and resetting the
wa tc hd og inp ut a t d iffe re nt p oints in the p rog ra m,
rather than “pulsing” the watchdog input high-low-high
or low-high-low. This technique avoids a “stuck” loop
where the watchdog timer continues to be reset within
the loop, keeping the watchdog from timing out.
START
SET
WDI
LOW
Figure 17 shows an example flow diagram where the
I/O driving the watchdog input is set high at the begin-
ning of the program, set low at the beginning of every
subroutine or loop, then set high again when the pro-
gram returns to the beginning. If the program should
“hang” in any subroutine, the I/O is continually set low
and the watchdog timer is allowed to time out, causing
a reset or interrupt to be issued.
SUBROUTINE
OR PROGRAM LOOP,
SET WDI
HIGH
Ma x im u m V
Fa ll Tim e
CC
RETURN
END
The V fall time is limited by the propagation delay of
CC
the b a tte ry s witc hove r c omp a ra tor a nd s hould not
exceed 0.03V/µs. A standard rule of thumb for filter
c a p a c ita nc e on mos t re g ula tors is on the ord e r of
100µF per amp of current. When the power supply is
shut off or the main battery is disconnected, the associ-
ated initial V fall rate is just the inverse or 1A / 100µF
Figure 17. Watchdog Flow Diagram
CC
= 0.01V/µs. The V
fall rate decreases with time as
CC
V
CC
falls exponentially, which more than satisfies the
maximum fall-time requirement.
______________________________________________________________________________________ 17