Rev. 2.50 68 June 22, 2017 Rev. 2.50 69 June 22, 2017
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
Watchdog Timer Operation
TheWatchdogTimeroperatesbyprovidingadeviceresetwhenitstimeroverows.Thismeans
thatintheapplicationprogramandduringnormaloperationtheuserhastostrategicallyclearthe
WatchdogTimerbeforeitoverowstopreventtheWatchdogTimerfromexecutingareset.Thisis
doneusingtheclearwatchdoginstructions.Iftheprogrammalfunctionsforwhateverreason,jumps
toanunkownlocation,orentersanendlessloop,theseclearinstructionswillnotbeexecutedinthe
correctmanner,inwhichcasetheWatchdogTimerwilloverowandresetthedevice.Someofthe
WatchdogTimeroptions,suchasenable/disable,clocksourceselectionandclearinstructiontype
areselectedusingcongurationoptions.Inadditiontoacongurationoptiontoenable/disablethe
WatchdogTimer,therearealsofourbits,WDTEN3~WDTEN0,intheWDTCregistertoofferan
additionalenable/disablecontroloftheWatchdogTimer.TodisabletheWatchdogTimer,aswell
asthecongurationoptionbeingsettodisable,theWDTEN3~WDTEN0bitsmustalsobesetto
aspecicvalueof"1010".AnyothervaluesforthesebitswillkeeptheWatchdogTimerenabled,
irrespectiveofthecongurationenable/disablesetting.Afterpoweronthesebitswillhavethevalue
of1010.IftheWatchdogTimerisuseditisrecommendedthattheyaresettoavalueof0101for
maximumnoiseimmunity.NotethatiftheWatchdogTimerhasbeendisabled,thenanyinstruction
relatingtoitsoperationwillresultinnooperation.
WDT Conguration Option WDTEN3~WDTEN0 Bits WDT
WDT Enable ×××× Enable
WDT Disable
Except 1010 Enable
WDT Disable
1010 Disable
Watchdog Timer Enable/Disable Control
Undernormalprogramoperation,aWatchdogTimertime-outwillinitialiseadeviceresetandset
thestatusbitTO.However,ifthesystemisintheSLEEPorIDLEMode,whenaWatchdogTimer
time-outoccurs,theTObitinthestatusregisterwillbesetandonlytheProgramCounterandStack
Pointerwillbereset.ThreemethodscanbeadoptedtoclearthecontentsoftheWatchdogTimer.
Therstisanexternalhardwarereset,whichmeansalowlevelontheRESpin,thesecondisusing
theWatchdogTimersoftwareclearinstructionsandthethirdisviaaHALTinstruction.
TherearetwomethodsofusingsoftwareinstructionstocleartheWatchdogTimer,oneofwhichmust
bechosenbycongurationoption.Therstoptionistousethesingle"CLRWDT"instructionwhile
thesecondistousethetwocommands"CLRWDT1"and"CLRWDT2".Fortherstoption,a
simpleexecutionof"CLRWDT"willcleartheWDTwhileforthesecondoption,both"CLRWDT1"
and"CLRWDT2"mustbothbeexecutedalternatelytosuccessfullycleartheWatchdogTimer.
Notethatforthissecondoption,if"CLRWDT1"isusedtocleartheWatchdogTimer,successive
executionsofthisinstructionwillhavenoeffect,onlytheexecutionofa"CLRWDT2"instruction
willcleartheWatchdogTimer.Similarlyafterthe"CLRWDT2"instructionhasbeenexecuted,only
asuccessive"CLRWDT1"instructioncancleartheWatchdogTimer.
Themaximumtimeoutperiodiswhenthe2
15
divisionratioisselected.Asanexample,witha
32.768kHzLXToscillatorasitssourceclock,thiswillgiveamaximumwatchdogperiodofaround
1secondforthe2
15
divisionratio,andaminimumtimeoutof7.8msforthe2
8
divisionration.Ifthe
f
SYS
/4clockisusedastheWatchdogTimerclocksource,itshouldbenotedthatwhenthesystem
enterstheSLEEPorIDLE0Mode,thentheinstructionclockisstoppedandtheWatchdogTimer
mayloseitsprotectingpurposes.Forsystemsthatoperateinnoisyenvironments,usingthef
SUB
clocksourceisstronglyrecommended.