Rev. 1.20 58 January 23, 2015 Rev. 1.20 59 January 23, 2015
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
CTRL Register
Bit 7 6 5 4 3 2 1 0
Name FSYSON — HIRCS1 HIRCS0 LXTLP LVRF D1 WRF
R/W R/W — R/W R/W R/W R/W R/W R/W
POR 0 — 0 0 0 x 0 0
"x"
unknown
Bit7 FSYSON:f
SYS
ControlinIDLEMode
Describeelsewhere
Bit6 Unimplemented,readas"0"
Bit
5~4 HIRCS1~HIRCS0:HIRCfrequencyclockselect
Describeelsewhere
Bit3 LXTLP:LXTlowpowercontrol
Describeelsewhere
Bit2 LVRF:LVRfunctionresetag
Describeelsewhere
Bit1 Undenedbit
Thisbitcanbereadorwrittenbyusersoftwareprogram
Bit0 WRF:WDTControlregistersoftwareresetag
0:Notoccur
1:Occurred
ThisbitissethighbytheWDTControlregistersoftwareresetandclearedbythe
applicationprogram.Notethatthisbitcanonlybeclearedtozerobytheapplication
program.
Watchdog Timer Operation
TheWatchdogTimeroperatesbyprovidingadeviceresetwhenitstimeroverows.Thismeans
thatintheapplicationprogramandduringnormaloperationtheuserhastostrategicallyclearthe
WatchdogTimerbeforeitoverowstopreventtheWatchdogTimerfromexecutingareset.Thisis
doneusingtheclearwatchdoginstructions.Iftheprogrammalfunctionsforwhateverreason,jumps
toanunknownlocation,orentersanendlessloop,theclearWDTinstructionwillnotbeexecutedin
thecorrectmanner,inwhichcasetheWatchdogTimerwilloverowandresetthedevice.Thereare
vebits,WE4~WE0,intheWDTCregistertoenabletheWDTfunction.WhentheWE4~WE0bits
valueisequalto01010Bor10101B,theWDTfunctionisenabled.However,iftheWE4~WE0bits
arechangedtoanyothervaluesexcept01010Band10101B,whichiscausedbytheenvironmental
noise,itwillresetthemicrocontrollerafter2~3LIRCclockcycles.Afterpoweronthesebitswill
haveavalueof01010B.
Undernormalprogramoperation,aWatchdogTimertime-outwillinitialiseadeviceresetandset
thestatusbitTO.However,ifthesystemisintheSLEEPorIDLEMode,whenaWatchdogTimer
time-outoccurs,theTObitinthestatusregisterwillbesetandonlytheProgramCounterandStack
Pointerwillbereset.ThreemethodscanbeadoptedtoclearthecontentsoftheWatchdogTimer.
TherstisaWDTsoftwarereset,whichmeansacertainvalueiswrittenintotheWE4~WE0bit
ledexcept01010Band10101B,thesecondisusingtheWatchdogTimersoftwareclearinstruction
andthethirdisviaaHALTinstruction.
ThereisonlyonemethodofusingsoftwareinstructiontocleartheWatchdogTimer.Thatistouse
thesingle"CLRWDT"instructiontocleartheWDT.
Themaximumtime-outperiodiswhenthe2
18
divisionratioisselected.Asanexample,witha32
kHzLIRCoscillatorasitssourceclock,thiswillgiveamaximumwatchdogperiodofaround8
secondsforthe2
18
divisionratio,andaminimumtimeoutof7.8msforthe2
8
divisionration.