Specifications

Application Examples
EXAMPLE 3: WATCHDOG TIMER
Objectives
A watchdog timer is useful in applications in which a microprocessor
controls a physical process that may be damaged if the
microprocessor fails to function as programmed. The ZT 8832
includes a jumper selectable watchdog timer which monitors
operation of the V40 and initiates corrective action if necessary.
As discussed in Chapter 13, the watchdog timer has two stages. In
normal operation, the application software strobes the watchdog timer
at a periodic rate less than the stage 1 timeout. If this strobe does not
take place, it is because the V40 is not operating as programmed. If
this happens, stage 1 times out and generates a non-maskable
interrupt.
The service routine designed to handle the non-maskable interrupt is
application specific. This example simply sets a flag in battery-backed
RAM to indicate the system failure, and loops until the stage 2
timeout resets the ZT 8832. While not implemented in this example,
the reset can be prevented by the non-maskable interrupt service
routine strobing the watchdog timer before the stage 2 timeout.
4-18