EasyManua.ls Logo

Holtek BS82B12A-3 - Page 136

Holtek BS82B12A-3
168 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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
INTC3 Register
Bit 7 6 5 4 3 2 1 0
Name LVDF LVDE
R/W R/W R/W
POR 0 0
Bit7~5 Unimplemented,readas"0"
Bit4 LVDF:LVDinterruptrequestflag
0:Norequest
1:Interruptrequest
Bit3~1 Unimplemented,readas"0"
Bit0 LVDE:LVDinterruptcontrol
0:Disable
1:Enable
Interrupt Operation
Whentheconditionsforaninterrupteventoccur,suchasaTouchKeyCounteroverflow,aTM
ComparatorPorComparatorAmatch,etc,therelevantinterruptrequestagwillbeset.Whether
therequestagactuallygeneratesaprogramjumptotherelevantinterruptvectorisdeterminedby
theconditionoftheinterruptenablebit.Iftheenablebitissethighthentheprogramwilljumpto
itsrelevantvector;iftheenablebitiszerothenalthoughtheinterruptrequestagissetanactual
interruptwillnotbegeneratedandtheprogramwillnotjumptotherelevantinterruptvector.The
globalinterruptenablebit,ifclearedtozero,willdisableallinterrupts.
Whenaninterruptisgenerated,theProgramCounter,whichstorestheaddressofthenextinstruction
tobeexecuted,willbetransferredontothestack.TheProgramCounterwillthenbeloadedwitha
newaddresswhichwillbethevalueofthecorrespondinginterruptvector.Themicrocontrollerwill
thenfetchitsnextinstructionfromthisinterruptvector.Theinstructionatthisvectorwillusually
bea"JMP"whichwilljumptoanothersectionofprogramwhichisknownastheinterruptservice
routine.Hereislocatedthecodetocontroltheappropriateinterrupt.Theinterruptserviceroutine
mustbeterminatedwitha"RETI",whichretrievestheoriginalProgramCounteraddressfrom
thestackandallowsthemicrocontrollertocontinuewithnormalexecutionatthepointwherethe
interruptoccurred.
Thevariousinterruptenablebits,togetherwiththeirassociatedrequestflags,areshowninthe
accompanyingdiagramswiththeirorderofpriority.Everyinterruptsourcehasitsownindividual
vector.Onceaninterruptsubroutineisserviced,alltheotherinterruptswillbeblocked,astheglobal
interruptenablebit,EMIbitwillbeclearedautomatically.Thiswillpreventanyfurtherinterrupt
nestingfromoccurring.However,ifotherinterruptrequestsoccurduringthisinterval,althoughthe
interruptwillnotbeimmediatelyserviced,therequestagwillstillberecorded.
Ifaninterruptrequiresimmediateservicingwhiletheprogramisalreadyinanotherinterruptservice
routine,theEMIbitshouldbesetafterenteringtheroutine,toallowinterruptnesting.Ifthestack
isfull,theinterruptrequestwillnotbeacknowledged,eveniftherelatedinterruptisenabled,until
theStackPointerisdecremented.Ifimmediateserviceisdesired,thestackmustbepreventedfrom
becomingfull.Incaseofsimultaneousrequests,theaccompanyingdiagramshowstheprioritythat
isapplied.Alloftheinterruptrequestagswhensetwillwake-upthedeviceifitisinSLEEPor
IDLEMode,howevertopreventawake-upfromoccurringthecorrespondingagshouldbeset
beforethedeviceisinSLEEPorIDLEMode.

Table of Contents

Related product manuals