Rev. 1.20 132 January 23, 2015 Rev. 1.20 133 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
Interrupts
Interruptsareanimportantpartofanymicrocontrollersystem.Whenanexternaleventoran
internalfunctionsuchasaTouchActionorTimer/EventCounteroverowrequiresmicrocontroller
attention,theircorrespondinginterruptwillenforceatemporarysuspensionofthemainprogram
allowingthemicrocontrollertodirectattentiontotheirrespectiveneeds.Thedevicescontainseveral
externalinterruptandinternalinterruptfunctions.Theexternalinterruptisgeneratedbytheactionof
theexternalINTpinandTouchKeys,whiletheinternalinterruptsaregeneratedbyvariousinternal
functionssuchasTimerModules,TimeBases,I
2
C,LVD,EEPROMandUART.
Interrupt Registers
Overallinterruptcontrol,whichbasicallymeansthesettingofrequestflagswhencertain
microcontrollerconditionsoccurandthesettingofinterruptenablebitsbytheapplicationprogram,
iscontrolledbyaseriesofregisters,locatedintheSpecialPurposeDataMemory,asshowninthe
accompanyingtable.Theregistersfallintotwocategories.TherstistheINTC0~INTC3registers
whichsetuptheprimaryinterrupts,thesecondistheINTEGregistertosetuptheexternalinterrupt
triggeredgetype.
Eachregistercontainsanumberofenablebitstoenableordisableindividualregistersaswellas
interruptflagstoindicatethepresenceofaninterruptrequest.Thenamingconventionofthese
followsaspecicpattern.Firstislistedanabbreviatedinterrupttype,thenthe(optional)numberof
thatinterruptfollowedbyeitheran"E"forenable/disablebitor"F"forrequestag.
Function Enable Bit Request Flag Notes
Global EMI — —
INT Pin INTE INTF —
Touch Key Module TKME TKMF —
I
2
C IICE IICF —
UART UARTE UARTF —
EEPROM DEE DEF —
LVD LVDE LVDF —
Time Base TBnE TBnF
n=0 or 1
TM
CTMPnE CTMPnF n=0
PTMPnE PTMPnF n=0
CTMAnE CTMAnF n=0
PTMAnE PTMAnF n=0
Interrupt Register Bit Naming Conventions
Interrupt Register Contents
Name Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
INTEG — — — — — — INTS1 INTS0
INTC0 — TB0F TKMF INTF TB0E TKME INTE EMI
INTC1 PTMA0F PTMP0F CTMA0F CTMP0F PTMA0E PTMP0E CTMA0E CTMP0E
INTC2 UARTF DEF IICF TB1F UARTE DEE IICE TB1E
INTC3 — — — LVDF — — — LVDE