Rev. 1.20 138 January 23, 2015 Rev. 1.20 139 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
Time Base Interrupts
ThefunctionoftheTimeBaseInterruptistoprovideregulartimesignalintheformofaninternal
interrupt.Itiscontrolledbytheoverflowsignalfromitstimerfunction.Whenthishappensits
interruptrequestflagsTBnFwillbeset.Toallowtheprogramtobranchtoitsinterruptvector
address,theglobalinterruptenablebit,EMIandTimeBaseenablebit,TBnE,mustfirstbeset.
Whentheinterruptisenabled,thestackisnotfullandtheTimeBaseoverows,asubroutinecallto
itsvectorlocationwilltakeplace.Whentheinterruptisserviced,theinterruptrequestag,TBnF,
willbeautomaticallyresetandtheEMIbitwillbeclearedtodisableotherinterrupts.
ThepurposeoftheTimeBaseInterruptistoprovideaninterruptsignalatxedtimeperiods.Each
TimeBaseclocksourceoriginatesfromanindependentinternalprescaler.
Each15-bitprescalercansourcefromf
SYS
,f
SYS
/4,f
SUB
orf
H
,selectedbyCLKSELn1~CLKSELn0
bitsinthePSCRregister.
PSCR Register
Bit 7 6 5 4 3 2 1 0
Name — — CLKSEL11 CLKSEL10 — — CLKSEL01 CLKSEL00
R/W — — R/W R/W — — R/W R/W
POR — — 0 0 — — 0 0
Bit7~6 Unimplemented,readas"0"
B
it5~4 CLKSEL11 ~ CLKSEL10:TimeBase1prescalerclocksourceselection
00:f
SYS
01:f
SYS
/4
10:f
SUB
11:f
H
Bit3~2 Unimplemented,readas"0"
B
it1~0 CLKSEL01 ~ CLKSEL00:TimeBase0prescalerclocksourceselection
00:f
SYS
01:f
SYS
/4
10:f
SUB
11:f
H
TBC Register
Bit 7 6 5 4 3 2 1 0
Name TB1ON TB12 TB11 TB10 TB0ON TB02 TB01 TB00
R/W R/W R/W R/W R/W R/W R/W R/W R/W
POR 0 0 0 0 0 0 0 0
Bit7 TB1ON:TimeBase1enable/disablecontrol
0:Disable
1:Enable
Bit6~4 TB12 ~ TB10:SelectTimeBase1Time-outPeriod
000:2
8
/f
PSC
001:2
9
/f
PSC
010:2
10
/f
PSC
011:2
11
/f
PSC
100:2
12
/f
PSC
101:2
13
/f
PSC
110:2
14
/f
PSC
111:2
15
/f
PSC