TC1796
System Units (Vol. 1 of 2)
Watchdog Timer
User’s Manual
16-25
V2.0, 2007-07
WDT, V2.0
Figure 16-4 Detection of False Jumps and Loops
Other schemes are possible. Consider the case in which a routine determines some
conditions that alter the program flow. One of two or more different paths will be executed
next, depending on these conditions. Before branching to the appropriate routine(s),
software performs a Watchdog service and sets the new password value for WDTPW
such that it depends on these conditions, that is, some or all of these condition codes
can be incorporated into WDTPW. The next service sequence is performed at the point
where the different paths come together again. To determine the correct password,
software uses a value returned from the path that was executed. This value must match
the value in WDTPW, otherwise the wrong path was executed.
shows an
example.
It is also possible to have the different paths of a program compute the full or partial
password to unlock register WDT_CON0. The password will only match at the next
MCA05753
Password access:
write xy
H
to WDTPW
Modify access:
set WDTPW to 10
H
WDTPW = 10
H
Next expected
Service
Sequence
n
Password access:
write 10
H
to WDTPW
Modify access:
set WDTPW to 11
H
WDTPW = 11
H
Next expected
Service
Sequence
n + 1
Password access:
write 11
H
to WDTPW
Modify access:
set WDTPW to 12
H
WDTPW = 12
H
Next expected
Service
Sequence
n + 2
Multiple
Execution
of Service:
Expected
WDTPW = 11
H
WDTPW
Written = 10
H
==>
Access Error
Omission
of Service:
Expected
WDTPW = 10
H
WDTPW
Written = 11
H
==>
Access Error