Rev. 2.50 216 June 22, 2017 Rev. 2.50 217 June 22, 2017
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
Interrupt Operation
Whentheconditionsforaninterrupteventoccur,suchasaTMComparatorP,ComparatorAor
ComparatorBmatchorA/Dconversioncompletionetc,therelevantinterruptrequestagwillbe
set.Whethertherequestagactuallygeneratesaprogramjumptotherelevantinterruptvectoris
determinedbytheconditionoftheinterruptenablebit.Iftheenablebitissethighthentheprogram
willjumptoitsrelevantvector;iftheenablebitiszerothenalthoughtheinterruptrequestagis
setanactualinterruptwillnotbegeneratedandtheprogramwillnotjumptotherelevantinterrupt
vector.Theglobalinterruptenablebit,ifclearedtozero,willdisableallinterrupts.
Whenaninterruptisgenerated,theProgramCounter,whichstorestheaddressofthenextinstruction
tobeexecuted,willbetransferredontothestack.TheProgramCounterwillthenbeloadedwitha
newaddresswhichwillbethevalueofthecorrespondinginterruptvector.Themicrocontrollerwill
thenfetchitsnextinstructionfromthisinterruptvector.Theinstructionatthisvectorwillusually
beaJMPwhichwilljumptoanothersectionofprogramwhichisknownastheinterruptservice
routine.Hereislocatedthecodetocontroltheappropriateinterrupt.Theinterruptserviceroutine
mustbeterminatedwithaRETI,whichretrievestheoriginalProgramCounteraddressfromthe
stackandallowsthemicrocontrollertocontinuewithnormalexecutionatthepointwherethe
interruptoccurred.
Thevariousinterruptenablebits,togetherwiththeirassociatedrequestflags,areshowninthe
accompanyingdiagramswiththeirorderofpriority.Someinterruptsourceshavetheirown
individualvectorwhileotherssharethesamemulti-functioninterruptvector.Onceaninterrupt
subroutineisserviced,alltheotherinterruptswillbeblocked,astheglobalinterruptenablebit,
EMIbitwillbeclearedautomatically.Thiswillpreventanyfurtherinterruptnestingfromoccurring.
However,ifotherinterruptrequestsoccurduringthisinterval,althoughtheinterruptwillnotbe
immediatelyserviced,therequestagwillstillberecorded.
Ifaninterruptrequiresimmediateservicingwhiletheprogramisalreadyinanotherinterruptservice
routine,theEMIbitshouldbesetafterenteringtheroutine,toallowinterruptnesting.Ifthestack
isfull,theinterruptrequestwillnotbeacknowledged,eveniftherelatedinterruptisenabled,until
theStackPointerisdecremented.Ifimmediateserviceisdesired,thestackmustbepreventedfrom
becomingfull.Incaseofsimultaneousrequests,theaccompanyingdiagramshowstheprioritythat
isapplied.Alloftheinterruptrequestagswhensetwillwake-upthedeviceifitisinSLEEPor
IDLEMode,howevertopreventawake-upfromoccurringthecorrespondingagshouldbeset
beforethedeviceisinSLEEPorIDLEMode.