Rev. 1.20 140 January 23, 2015 Rev. 1.20 141 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
LVD Interrupt
AnLVDInterruptrequestwilltakeplacewhentheLVDInterruptrequestag,LVDF,isset,which
occurswhentheLowVoltageDetectorfunctiondetectsalowpowersupplyvoltage.Toallowthe
programtobranchtoitsrespectiveinterruptvectoraddress,theglobalinterruptenablebit,EMI,and
LowVoltageInterruptenablebit,LVDE,mustrstbeset.Whentheinterruptisenabled,thestackis
notfullandalowvoltageconditionoccurs,asubroutinecalltotheLV DInterruptvector,willtake
place.WhentheLowVoltageInterruptisserviced,theLVDFagwillbeautomaticallyclearedand
theEMIbitwillbeautomaticallyclearedtodisableotherinterrupts.
Touch Key Interrupt
ForaTouchKeyinterrupttooccur,theglobalinterruptenablebit,EMI,andtheTouchKeyinterrupt
enableTKMEmustberstset.AnactualTouchKeyinterruptwilltakeplacewhentheTouchKey
requestag.TKMF,isset,asituationthatwilloccurwhenthetimeslotcounteroverows.When
theinterruptisenabled,thestackisnotfullandtheTouchKeytimeslotcounteroverowoccurs,a
subroutinecalltotherelevanttimerinterruptvector,willtakeplace.Whentheinterruptisserviced,
theTouchKeyinterruptrequestag,TKMF,willbeautomaticallyresetandtheEMIbitwillbe
automaticallyclearedtodisableotherinterrupts.
I
2
C Interrupt
AnI
2
CInterruptrequestwilltakeplacewhentheI
2
CInterruptrequestag,IICF,isset,whichoccurs
whenanaddressmatchoccurs,oranI
2
Ccommunicationtime-outoccurs,orabyteofdatahas
beenreceivedortransmittedbytheI
2
Cinterface.Toallowtheprogramtobranchtoitsrespective
interruptvectoraddress,theglobalinterruptenablebit,EMI,andtheI
2
CInterfaceInterrupt
enablebit,IICE,mustrstbeset.Whentheinterruptisenabled,thestackisnotfullandanythese
conditionsarecreated,asubroutinecalltotherespectiveinterruptvector,willtakeplace.Whenthe
I
2
CInterfaceInterruptisserviced,theI
2
Cinterruptrequestag,IICF,willbeautomaticallycleared
andtheEMIbitwillbeautomaticallyclearedtodisableotherinterrupts.
UART Interrupt
SeveralindividualUARTconditionscangenerateaUARTinterrupt.Whentheseconditionsexist,
alowpulsewillbegeneratedtogettheattentionofthemicrocontroller.Theseconditionsarea
transmitterdataregisterempty,transmitteridle,receiverdataavailable,receiveroverrun,address
detectandanRXpinwake-up.Toallowtheprogramtobranchtotherespectiveinterruptvector
addresses,theglobalinterruptenablebit,EMI,andUARTinterruptenablebit,UARTE,mustrst
beset.Whentheinterruptisenabled,thestackisnotfullandanyoftheseconditionsarecreated,
asubroutinecalltotheUARTInterruptvectorwilltakeplace.Whentheinterruptisserviced,the
UARTInterruptag,UARTF,willbeautomaticallycleared.TheEMIbitwillalsobeautomatically
clearedtodisableotherinterrupts.However,theUSRregisteragswillbeclearedautomatically
whencertainactionsaretakenbytheUART,thedetailsofwhicharegivenintheUARTsection.