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
Bit3 TB0ON:TimeBase0enable/disablecontrol
0:Disable
1:Enable
Bit2~0 TB02 ~ TB00: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
f
SYS
/4
CLKSELn[1:0]
f
SUB
f
SYS
Prescaler
TBnON
f
PSC
TBn[2:0]
TimeBasenInterrupt
f
H
Time Base Structure (n=0 or 1)
TM Interrupts
TheCompactandPeriodictypeTMseachhastwointernalinterrupts,theinternalcomparatorAor
comparatorP,whichgeneratesaTMinterruptwhenacomparematchconditionoccurs.Foreach
oftheCompactandPeriodicTypeTMs,therearetwointerruptrequestags,CTMP0F/CTMA0F
andPTMP0F/PTMA0F,andtwoenablebits,CTMP0E/CTMA0EandPTMP0E/PTMA0E.ATM
interruptrequestwilltakeplacewhenanyoftheTMrequestagsareset,asituationwhichoccurs
whenaTMcomparatorPorAmacthsituationhappens.Toallowtheprogramtobranchtoits
respectiveinterruptvectoraddress,theglobalinterruptenablebit,EMI,therespectiveTMinterrupt
enablebitmustrstbeset.Whentheinterruptisenabled,thestackisnotfullandaTMcomparator
matchsituationoccurs,asubroutinecalltotherelevantTMinterruptvectorlocation,willtakeplace.
WhentheTMinterruptisserviced,theTMinterruptrequestagwillbeautomaticallyresetandthe
EMIbitwillbeautomaticallyclearedtodisableotherinterrupts.
EEPROM Interrupt
AnEEPROMInterruptrequestwilltakeplacewhentheEEPROMInterruptrequestag,DEF,isset,
whichoccurswhenanEEPROMWritecycleends.Toallowtheprogramtobranchtoitsrespective
interruptvectoraddress,theglobalinterruptenablebit,EMI,andEEPROMInterruptenablebit,
DEE,mustrstbeset.Whentheinterruptisenabled,thestackisnotfullandanEEPROMWrite
cycleends,asubroutinecalltotherespectiveEEPROMInterruptvector,willtakeplace.Whenthe
EEPROMInterruptisserviced,theDEFagwillbeautomaticallyclearedandtheEMIbitwillbe
automaticallyclearedtodisableotherinterrupts.