TC1796
System Units (Vol. 1 of 2)
Watchdog Timer
User’s Manual
16-23
V2.0, 2007-07
WDT, V2.0
Bit fields WDT_CON0.WDTREL and WDT_CON0.WDTPW can optionally be changed
during the Valid Modify Access, but it is not required. WDT_CON0.ENDINIT can be set
to 1 or 0; however, setting ENDINIT to 0 does not stop Time-Out Mode. Any values
written to WDTREL, WDTPW, and ENDINIT are stored in WDT_CON0, and
WDT_CON0 is automatically locked (WDTLCK = 1) after the Modify Access is finished.
16.5.2
Re-opening Access to Critical System Registers
If some or all of the system’s Endinit-protected registers must be changed during run
time of an application, access can be re-opened. To do this, WDT_CON0 must first be
unlocked with a Valid Password Access. In the subsequent Valid Modify Access,
ENDINIT can be set to 0. Access to Endinit-protected registers is now open again.
However, when WDT_CON0 is unlocked, the WDT is automatically switched to Time-
Out Mode. Thus, the access window is time-limited. Time-Out Mode is only terminated
after ENDINIT has been set to 1 again, requiring another Valid Password and Valid
Modify Access to WDT_CON0.
If the WDT is not used in an application and is therefore disabled
(WDT_SR.WDTDS = 1), the above described case is the only occasion when
WDT_CON0 must be accessed again after the system is initialized. If there are no further
changes to critical system registers needed, no further accesses to WDT_CON0,
WDT_CON1, or WDT_SR are necessary. However, it is always recommended that the
WDT be used in an application for safety reasons.
16.5.3
Servicing the Watchdog Timer
If the WDT is used in an application and is enabled (WDT_SR.WDTDS = 0), it must be
regularly serviced to prevent it from overflowing.
Service is performed in two steps. a Valid Password Access followed by a Valid Modify
Access. The Valid Password Access to WDT_CON0 automatically switches the WDT to
Time-Out Mode. Thus, the Modify Access must be performed before the Time-out
expires or a system reset will result.
During the next Modify Access, the strict requirement is that WDT_CON0.ENDINIT as
well as bit 1 and bits [7:4] are written with 1, while bits [3:2] are written with 0.
Note: ENDINIT must be written with 1 to perform a proper service, even if it is already
set to 1.
Changes to the reload value WDTREL, or the user-definable password WDTPW, are not
required. However, changing WDTPW is recommended so that software can monitor
WDT service operations throughout the duration of an application program (see next
section).
If WDT service is properly executed, Time-Out Mode is terminated, and the WDT
switches back to its former mode of operation, and WDT service is complete.