Rev. 1.20 50 January 23, 2015 Rev. 1.20 51 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
Control Register
TheSMODregisterisusedtocontroltheinternalclockswithinthedevices.
SMOD Register
Bit 7 6 5 4 3 2 1 0
Name CKS2 CKS1 CKS0 — LTO HTO IDLEN HLCLK
R/W R/W R/W R/W — R R R/W R/W
POR 0 0 0 — 0 0 1 1
Bit7~5 CKS2 ~ CKS0:ThesystemclockselectionwhenHLCLKis"0"
000:f
SUB
(LIRCorLXT)
001:f
SUB
(LIRCorLXT)
010:f
H
/64
011:f
H
/32
100:f
H
/16
101:f
H
/8
110:f
H
/4
111:f
H
/2
Thesethreebitsareusedtoselectwhichclockisusedasthesystemclocksource.In
additiontothesystemclocksource,whichcanbeeithertheLXTorLIRC,adivided
versionofthehighspeedsystemoscillatorcanalsobechosenasthesystemclocksource.
Bit4 Unimplemented,readas"0".
Bit3 LTO:Lowspeedsystemoscillatorreadyag
0:Notready
1:Ready
Thisisthelowspeedsystemoscillatorreadyagwhichindicateswhenthelowspeed
systemoscillatorisstableafterpoweronresetorawake-uphasoccurred.Theag
willbelowwhenintheSLEEPmodebutafterawake-uphasoccurred,theagwill
changetoahighlevelafter1024clockcyclesifLXToscillatorisusedand1~2clock
cyclesiftheLIRCoscillatorisused.
Bit2 HTO:Highspeedsystemoscillatorreadyag
0:Notready
1:Ready
Thisisthehighspeedsystemoscillatorreadyflagwhichindicateswhenthehigh
speedsystemoscillatorisstableafterawake-uphasoccurred.Thisagisclearedto
zerobyhardwarewhenthedeviceispoweredonandthenchangestoahighlevelafter
thehighspeedsystemoscillatorisstable.Thereforethisagwillalwaysbereadas"1"
bytheapplicationprogramafterdevicepower-on.Theagwillbelowwheninthe
SLEEPorIDLE0Modebutafterpoweronresetorawake-uphasoccurred,theag
willchangetoahighlevelafter15~16clockcyclesiftheHIRCoscillatorisused.
Bit1 IDLEN:IDLEModeControl
0:Disable
1:Enable
ThisistheIDLEModeControlbitanddetermineswhathappenswhentheHALT
instructionis executed.Ifthisbitishigh,whenaHALTinstructionisexecutedthe
devicewillentertheIDLEMode.IntheIDLE1ModetheCPUwillstoprunning
butthesystemclockwillcontinueto keeptheperipheralfunctionsoperational,if
FSYSONbitishigh.IfFSYSONbitislow,theCPUandthesystemclockwillallstop
inIDLE0mode.IfthebitislowthedevicewillentertheSLEEPModewhenaHALT
instructionisexecuted.
Bit0 HLCLK:SystemClockSelection
0:f
H
/2~f
H
/64orf
SUB
1:f
H
Thisbitisusedtoselectifthef
H
clockorthef
H
/2~f
H
/64orf
SUB
clockisusedasthe
systemclock.Whenthebitishighthef
H
clockwillbeselectedandiflowthef
H
/2~
f
H
/64orf
SUB
clockwillbeselected.Whensystemclockswitchesfromthef
H
clockto
thef
SUB
clockandthef
H
clockwillbeautomaticallyswitchedofftoconservepower.