BS83A04A-3/BS83A04A-4
8-bit Touch Key Flash MCU
Programming Considerations
TheꢀhighꢀspeedꢀandꢀlowꢀspeedꢀoscillatorsꢀbothꢀuseꢀtheꢀsameꢀSSTꢀcounter.ꢀForꢀexample,ꢀifꢀtheꢀsystemꢀ
isꢀwokenꢀupꢀfromꢀtheꢀSLEEPꢀModeꢀtheꢀHIRCꢀoscillatorꢀneedsꢀtoꢀstart-upꢀfromꢀanꢀoffꢀstate.
IfꢀtheꢀdeviceꢀisꢀwokenꢀupꢀfromꢀtheꢀSLEEPꢀModeꢀtoꢀtheꢀNORMALꢀMode,ꢀtheꢀhighꢀspeedꢀsystemꢀ
oscillatorꢀneedsꢀanꢀSSTꢀperiod.ꢀTheꢀdeviceꢀwillꢀexecuteꢀtheꢀfirstꢀinstructionꢀafterꢀHTOꢀisꢀhigh.
Watchdog Timer
TheꢀWatchdogꢀTimerꢀisꢀprovidedꢀtoꢀpreventꢀprogramꢀmalfunctionsꢀorꢀsequencesꢀfromꢀjumpingꢀtoꢀ
unknownꢀlocations,ꢀdueꢀtoꢀcertainꢀuncontrollableꢀexternalꢀeventsꢀsuchꢀasꢀelectricalꢀnoise.
Watchdog Timer Clock Source
TheꢀWatchdogꢀTimerꢀclockꢀsourceꢀisꢀprovidedꢀbyꢀtheꢀinternalꢀclockꢀfSUB,ꢀwhichꢀisꢀsourcedꢀfromꢀtheꢀ
LIRCꢀoscillator.ꢀTheꢀWatchdogꢀTimerꢀsourceꢀclockꢀisꢀthenꢀsubdividedꢀbyꢀaꢀratioꢀofꢀ28ꢀtoꢀ218ꢀtoꢀgiveꢀ
longerꢀtimeouts,ꢀtheꢀactualꢀvalueꢀbeingꢀchosenꢀusingꢀtheꢀWS2~WS0ꢀbitsꢀinꢀtheꢀWDTCꢀregister.ꢀTheꢀ
LIRCꢀinternalꢀoscillatorꢀhasꢀanꢀapproximateꢀperiodꢀfrequencyꢀofꢀ32KHzꢀatꢀaꢀsupplyꢀvoltageꢀofꢀ5V.ꢀ
However,ꢀitꢀshouldꢀbeꢀnotedꢀthatꢀthisꢀspecifiedꢀinternalꢀclockꢀperiodꢀcanꢀvaryꢀwithꢀVDD,ꢀtemperatureꢀ
andꢀprocessꢀvariations.
Watchdog Timer Control Register
Aꢀsingleꢀregister,ꢀWDTC,ꢀcontrolsꢀtheꢀrequiredꢀtimeꢀoutꢀperiod.
WDTC Register
Bit
Name
R/W
7
6
5
4
3
2
1
0
WE4
R/W
0
WEꢇ
R/W
1
WEꢄ
R/W
0
WE1
R/W
1
WE0
R/W
0
WSꢄ
R/W
0
WS1
R/W
1
WS0
R/W
1
POR
Bitꢀ7~ꢀ3ꢀ
WE4 ~ WE0:ꢀWDTꢀfunctionꢀsoftwareꢀcontrol
ꢀ 10101B:ꢀenabled
ꢀ 01010B:ꢀenabledꢀ(Default)
ꢀ
Otherꢀvalues:ꢀResetꢀMCUꢀ(Resetꢀwillꢀbeꢀactiveꢀafterꢀ2~3ꢀLIRCꢀclockꢀforꢀdebounceꢀtime.)
IfꢀtheꢀꢀMCUꢀꢀresetꢀcausedꢀbyꢀtheꢀWEꢀ[4:0]ꢀinꢀWDTCꢀsoftwareꢀreset,ꢀtheꢀWRFꢀflagꢀofꢀ
CTRLꢀregisterꢀwillꢀbeꢀset).
Bitꢀ2~ꢀ0ꢀ
WS2 ~ WS0:ꢀWDTꢀTime-outꢀperiodꢀselection
ꢀ 000:ꢀ28/fSUB
ꢀ 001:ꢀ210/fSUB
ꢀ 010:ꢀ212/fSUB
ꢀ 011:ꢀ214/fSUB
ꢀ 100:ꢀ215/fSUB
ꢀ 101:ꢀ216/fSUB
ꢀ 110:ꢀ217/fSUB
ꢀ 111:ꢀ218/fSUB
ꢀ
TheseꢀthreeꢀbitsꢀdetermineꢀtheꢀdivisionꢀratioꢀofꢀtheꢀWatchdogꢀTimerꢀsourceꢀclock,ꢀ
whichꢀinꢀturnꢀdeterminesꢀtheꢀtimeoutꢀperiod.
Rev. 1.00
ꢇ1
�eꢀꢁꢂaꢁꢃ ꢄꢅꢆ ꢄ01ꢇ