BS85B12-3/BS85C20-3/BS85C20-5
Touch Key Flash MCU with LCD/LED Driver
Watchdog Timer Operation
InꢀtheseꢀdevicesꢀtheꢀWatchdogꢀTimerꢀsuppliedꢀbyꢀtheꢀfLIRCꢀoscillatorꢀandꢀisꢀthereforeꢀalwaysꢀon.ꢀTheꢀ
WatchdogꢀTimerꢀoperatesꢀbyꢀprovidingꢀaꢀdeviceꢀresetꢀwhenꢀitsꢀtimerꢀoverflows.ꢀThisꢀmeansꢀthatꢀinꢀ
theꢀapplicationꢀprogramꢀandꢀduringꢀnormalꢀoperationꢀtheꢀuserꢀhasꢀtoꢀstrategicallyꢀclearꢀtheꢀWatchdogꢀ
TimerꢀbeforeꢀitꢀoverflowsꢀtoꢀpreventꢀtheꢀWatchdogꢀTimerꢀfromꢀexecutingꢀaꢀreset.ꢀThisꢀisꢀdoneꢀusingꢀ
theꢀclearꢀwatchdogꢀinstructions.ꢀꢀIfꢀꢀtheꢀꢀprogramꢀꢀmalfunctionsꢀꢀforꢀꢀwhateverꢀreason,ꢀjumpsꢀtoꢀ
anꢀunkownꢀlocation,ꢀorꢀentersꢀanꢀendlessꢀloop,ꢀtheseꢀclearꢀinstructionsꢀwillꢀnotꢀbeꢀexecutedꢀinꢀtheꢀ
correctꢀmanner,ꢀinꢀwhichꢀcaseꢀtheꢀWatchdogꢀTimerꢀwillꢀoverflowꢀandꢀresetꢀtheꢀdevice.
Underꢀnormalꢀprogramꢀoperation,ꢀaꢀWatchdogꢀTimerꢀtime-outꢀwillꢀinitialiseꢀaꢀdeviceꢀresetꢀandꢀsetꢀ
theꢀstatusꢀbitꢀTO.ꢀHowever,ꢀifꢀtheꢀsystemꢀisꢀinꢀtheꢀSLEEPꢀorꢀIDLEꢀMode,ꢀwhenꢀaꢀWatchdogꢀTimerꢀ
time-outꢀoccurs,ꢀtheꢀTOꢀbitꢀinꢀtheꢀstatusꢀregisterꢀwillꢀbeꢀsetꢀandꢀonlyꢀtheꢀProgramꢀCounterꢀandꢀStackꢀ
Pointerꢀwillꢀbeꢀreset.ꢀThreeꢀmethodsꢀcanꢀbeꢀadoptedꢀtoꢀclearꢀtheꢀcontentsꢀofꢀtheꢀWatchdogꢀTimer.ꢀ
Theꢀfirstꢀisꢀanꢀexternalꢀhardwareꢀreset,ꢀtheꢀsecondꢀisꢀusingꢀtheꢀWatchdogꢀTimerꢀsoftwareꢀclearꢀ
instructionsꢀandꢀtheꢀthirdꢀisꢀviaꢀaꢀHALTꢀinstruction.ꢀTheꢀWatchdogꢀTimerꢀisꢀclearedꢀusingꢀaꢀsingleꢀ
CLRꢀWDTꢀinstruction.
Theꢀmaximumꢀtimeꢀoutꢀperiodꢀisꢀwhenꢀtheꢀ215ꢀdivisionꢀratioꢀisꢀselected.ꢀAsꢀanꢀexample,ꢀwithꢀtheꢀ
LIRCꢀoscillatorꢀasꢀitsꢀsourceꢀclock,ꢀthisꢀwillꢀgiveꢀaꢀmaximumꢀwatchdogꢀperiodꢀofꢀaroundꢀ1ꢀsecondꢀ
forꢀtheꢀ215ꢀdivisionꢀratio,ꢀandꢀaꢀminimumꢀtimeoutꢀofꢀ7.8msꢀforꢀtheꢀ28ꢀdivisionꢀration.
C
e
l
a
W
D
r
T
I
s
n
r
t
c
u
t
o
i
n
C
L
R
8
f
L
R
I
/
C
2
L
R
I
C
O
s
c
t
i
r
o
l
l
a
8
s
-
a
t
g
D
e
v
i
d
i
e
r
W
T
D
P
e
r
c
s
a
l
e
r
W
T
D
m
T
-
i
e
o
u
t
8
t
-
-
o
1
M
U
X
8
1
5
(
2
/
L
f
R
I
C
~
2
/
L
f
R
I
C
W
2
S
W
~
0
S
Watchdog Timer
Rev. 1.20
53
�ꢀꢁꢀst 10ꢂ 2012