English
Language : 

33812 Datasheet, PDF (18/25 Pages) Freescale Semiconductor, Inc – SMALL ENGINE CONTROL IC
FUNCTIONAL DEVICE OPERATION
WATCHDOG TIMER OPERATION
WATCHDOG TIMER OPERATION
The purpose of the watchdog timer is to provide a RESET
to the MCU whenever the MCU is locked up in a loop or
otherwise hung up, perhaps by executing erroneous code,
such as a HALT instruction. The watchdog timer is initialized
by a power on RESET or a RESET that occurs after a fault
such as an under-voltage event on VCC.
Whenever the watchdog timer is refreshed, it is always
reloaded with the value WDRELOAD which initially has a value
of WDMAX seconds. Whenever a RESET occurs, the
WDRELOAD value is set to WDMAX seconds and the watchdog
timer is re-loaded with this value. When the RESET pulse
returns high, and, if the WDRFSH line is low, the watchdog
timer starts counting. If the watchdog timer reaches the
WDMAX value before the next rising edge on the WDRFSH
line, the watchdog circuit will generate a RESET pulse to the
MCU and reload itself with the maximum time value of
WDRELOAD, which will have been set back to WDMAX
seconds.
In normal operation, the MCU will issue a WDRFSH pulse,
periodically, which re-loads the watchdog timer with the
WDRELOAD value and starts the counting again, thus avoiding
a watchdog timer generated RESET pulse. When the
watchdog timer is refreshed by a WDRFSH pulse, before the
watchdog timer reaches the programmed value, the refresh
will prevent a RESET pulse from being issued to the MCU.
Loading the Watchdog Timer and WDRELOAD
Aside from the RESET case, which always loads the
WDRELOAD value and the watchdog timer with the maximum
time value, WDMAX, there is an additional way that the
watchdog timer and the value WDRELOAD can be re-loaded.
During initialization, if the WDRFSH pulse width is greater
than WDLOAD, both the watchdog timer and the value
WDRELOAD will be loaded with a timer count value,
corresponding to the width of the pulse present on the
WDRFSH input. Once this value is set, no further setting of
the WDLOAD value is possible until a RESET is performed.
Once the WDRFSH input goes low, the watchdog timer will
begin incrementing again, counting up to the new value that
has been loaded into the reload register. The watchdog must
be refreshed by another pulse on the WDRFSH line, before
the watchdog timer counts up to the reload value, or else a
RESET pulse will be generated and sent to the MCU.
If the WDRFSH line is ever kept high for longer than
WDRELOAD seconds, the watchdog will issue an immediate
RESET to the MCU. Upon receiving a RESET input from the
33812, the MCU should always be programmed to bring the
WDRFSH line low to avoid being locked in a “deadly
embrace” condition where the MCU and 33812 alternate
back and forth between the RESET and Normal states.
Disabling the Watchdog Timer
If the WD_INH line is pulled high through a pull-up resistor
of 10 K or less, (i.e. not tied to ground), the watchdog timer
will be inhibited from issuing a RESET to the MCU, while the
line is held in this state. This “watchdog Inhibited” state
should only be used during software testing and development
to avoid being concerned about an inadvertent watchdog
RESET.
Watchdog Timing Diagrams
Watchdog Loaded with WDMAX
5
4
3
WDRFSH
2
1
0
Time
Holding WDRFSH high will trigger RESET every WDMAX time
Voltage
5
RESET
4
3
2
1
Watchdog timer
& WDRELOAD= WDMAX
0
RESET loads the watchdog timer and WDRELOAD with WDMAXTime
Voltage
5
4
3
2
1
0
PWA<WDLOAD
WDRFSH
Time
Refresh pulses, PWA, on WDRFSH load the Watchdog timer with the
WDRELOAD
Voltage
5
4
3
PWB >WDLOAD
2
1
0
WDRFSH
Time
During initialization, for the first WDRFSH pulse only, PWB, that is greater
than WDLOAD but less than WDMAX, the Watchdog timer and WDRELOAD
value will be loaded with a time value corresponding to the width of that
pulse, PWB. All pulses on the WDRFSH line width less than WDRELOAD, will
result in the Watchdog timer being reloaded with the time value correspond-
ing to PWB. This programmability is only allowed once per RESET.
33812
18
Analog Integrated Circuit Device Data
Freescale Semiconductor