beautypg.com

Texas Instruments MSC1210 User Manual

Page 180

background image

Watchdog Timer

14-6

Although the watchdog timeout value (0x07 in the previous example) may be
set at the same time as the EWDT bit is cleared, it may be changed after the
fact. If the timeout value is changed after the watchdog has been enabled, the
new timeout will take effect the next time the watchdog times out, or the next
time the watchdog is reset (see next section). For example:

WDTCON = 0x80; // Set EWDT

WDTCON = 0x07; // Clear EWDT, set timeout = 7, 800ms

WDTCON = 0x06; // Set timeout = 6, 700ms

In this example, the watchdog will initially be enabled with a timeout of 800ms.
The very next instruction sets the timeout to 700ms. In this case, the watchdog
will time out after 800ms, unless it is reset as described in the following section.
Once the watchdog has been reset, the new timeout of 700ms will take effect.