Rev. 1.20 136 January 23, 2015 Rev. 1.20 137 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
INT Pin
Touch Key Module
INTF
TKMF
INTE
TKME
EMI 04H
EMI 24H
28H
Interrupt
Name
Request
Flags
Enable
Bits
Master
Enable
Vector
EMI auto disabled in ISR
Priority
High
Low
CTM0 A CTMA0F CTMA0E
xxE Enable Bits
xxF Request Flag, auto reset in ISR
Legend
EMI 08H
I
2
C IICF IICE
EMI 10H
EMI
14H
Time Base 1 TB1F TB1E
Time Base 0 TB0F TB0E EMI 0CH
EEPROM DEF DEE
EMI
18H
1CH
CTM0 P CTMP0F CTMP0E
EMI 20H
PTM0 P PTMP0F PTMP0E EMI
PTM0 A PTMA0F PTMA0E EMI
EMI 2CHUART UARTF UARTE
EMI 30HLVD LVDF LVDE
Interrupt Structure
External Interrupt
TheexternalinterruptiscontrolledbysignaltransitionsonthepinINT.Anexternalinterrupt
requestwilltakeplacewhentheexternalinterruptrequestflag,INTF,isset,whichwilloccur
whenatransition,whosetypeischosenbytheedgeselectbits,appearsontheexternalinterrupt
pin.Toallowtheprogramtobranchtoitsrespectiveinterruptvectoraddress,theglobalinterrupt
enablebit,EMI,andrespectiveexternalinterruptenablebit,INTE,mustrstbeset.Additionally
thecorrectinterruptedgetypemustbeselectedusingtheINTEGregistertoenabletheexternal
interruptfunctionandtochoosethetriggeredgetype.Astheexternalinterruptpinispin-shared
withI/Opin,itcanonlybeconguredasexternalinterruptpinifitsexternalinterruptenablebitin
thecorrespondinginterruptregisterhasbeenset.Thepinmustalsobesetupasaninputbysetting
thecorrespondingbitintheportcontrolregister.Whentheinterruptisenabled,thestackisnotfull
andthecorrecttransitiontypeappearsontheexternalinterruptpin,asubroutinecalltotheexternal
interruptvector,willtakeplace.Whentheinterruptisserviced,theexternalinterruptrequestag,
INTF,willbeautomaticallyresetandtheEMIbitwillbeautomaticallyclearedtodisableother
interrupts.Notethatanypull-highresistorselectionsontheexternalinterruptpinwillremainvalid
evenifthepinisusedasanexternalinterruptinput.
TheINTEGregisterisusedtoselectthetypeofactiveedgethatwilltriggertheexternalinterrupt.
Achoiceofeitherrisingorfallingorbothedgetypescanbechosentotriggeranexternalinterrupt.
NotethattheINTEGregistercanalsobeusedtodisabletheexternalinterruptfunction.