Rev. 1.71 114 April 11, 2017 Rev. 1.71 115 April 11, 2017
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
MFI1 Register – HT66F003 only
Bit 7 6 5 4 3 2 1 0
Name — — PTMA1F PTMP1F — — PTMA1E PTMP1E
R/W — — R/W R/W — — R/W R/W
POR — — 0 0 — — 0 0
B
it7~6 Unimplemented,readas"0"
Bit5 PTMA1F:PTMComparatorAmatchinterruptrequestag
0:Norequest
1:Interruptrequest
Bit4 PTMP1F:PTMComparatorPmatchinterruptrequestag
0:Norequest
1:Interruptrequest
Bit3~2 Unimplemented,readas"0"
Bit1 PTMA1E:PTMComparatorAmatchinterruptcontrol
0:Disable
1:Enable
B
it0 PTMP1E:PTMComparatorPmatchinterruptcontrol
0:Disable
1:Enable
Interrupt Operation
Whentheconditionsforaninterrupteventoccur,suchasaTMComparatorPorComparatorA
matchorA/Dconversioncompletionetc,therelevantinterruptrequestagwillbeset.Whether
therequestagactuallygeneratesaprogramjumptotherelevantinterruptvectorisdeterminedby
theconditionoftheinterruptenablebit.Iftheenablebitissethighthentheprogramwilljumpto
itsrelevantvector;iftheenablebitiszerothenalthoughtheinterruptrequestagissetanactual
interruptwillnotbegeneratedandtheprogramwillnotjumptotherelevantinterruptvector.The
globalinterruptenablebit,ifclearedtozero,willdisableallinterrupts.
Whenaninterruptisgenerated,theProgramCounter,whichstorestheaddressofthenextinstruction
tobeexecuted,willbetransferredontothestack.TheProgramCounterwillthenbeloadedwitha
newaddresswhichwillbethevalueofthecorrespondinginterruptvector.Themicrocontrollerwill
thenfetchitsnextinstructionfromthisinterruptvector.Theinstructionatthisvectorwillusually
bea“JMP”whichwilljumptoanothersectionofprogramwhichisknownastheinterruptservice
routine.Hereislocatedthecodetocontroltheappropriateinterrupt.Theinterruptserviceroutine
mustbeterminatedwitha“RETI”,whichretrievestheoriginalProgramCounteraddressfrom
thestackandallowsthemicrocontrollertocontinuewithnormalexecutionatthepointwherethe
interruptoccurred.
Thevariousinterruptenablebits,togetherwiththeirassociatedrequestflags,areshowninthe
accompanyingdiagramswiththeirorderofpriority. Someinterruptsourceshavetheirown
individualvectorwhileotherssharethesamemulti-functioninterruptvector.Onceaninterrupt
subroutineisserviced,alltheotherinterruptswillbeblocked,astheglobalinterruptenablebit,
EMIbitwillbeclearedautomatically.Thiswillpreventanyfurtherinterruptnestingfromoccurring.
However,ifotherinterruptrequestsoccurduringthisinterval,althoughtheinterruptwillnotbe
immediatelyserviced,therequestagwillstillberecorded.