Rev. 2.50 220 June 22, 2017 Rev. 2.50 221 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
External Interrupt
TheexternalinterruptsarecontrolledbysignaltransitionsonthepinsINT0~INT3.Anexternal
interruptrequestwilltakeplacewhentheexternalinterruptrequestags,INT0F~INT3F,areset,
whichwilloccurwhenatransition,whosetypeischosenbytheedgeselectbits,appearsonthe
externalinterruptpins.Toallowtheprogramtobranchtoitsrespectiveinterruptvectoraddress,the
globalinterruptenablebit,EMI,andrespectiveexternalinterruptenablebit,INT0E~INT3E,must
rstbeset.AdditionallythecorrectinterruptedgetypemustbeselectedusingtheINTEGregisterto
enabletheexternalinterruptfunctionandtochoosethetriggeredgetype.Astheexternalinterrupt
pinsarepin-sharedwithI/Opins,theycanonlybeconfiguredasexternalinterruptpinsiftheir
externalinterruptenablebitinthecorrespondinginterruptregisterhasbeenset.Thepinmustalso
besetupasaninputbysettingthecorrespondingbitintheportcontrolregister.Whentheinterrupt
isenabled,thestackisnotfullandthecorrecttransitiontypeappearsontheexternalinterruptpin,
asubroutinecalltotheexternalinterruptvector,willtakeplace.Whentheinterruptisserviced,the
externalinterruptrequestags,INT0F~INT3F,willbeautomaticallyresetandtheEMIbitwillbe
automaticallyclearedtodisableotherinterrupts.Notethatanypull-highresistorselectionsonthe
externalinterruptpinswillremainvalidevenifthepinisusedasanexternalinterruptinput.
TheINTEGregisterisusedtoselectthetypeofactiveedgethatwilltriggertheexternalinterrupt.
Achoiceofeitherrisingorfallingorbothedgetypescanbechosentotriggeranexternalinterrupt.
NotethattheINTEGregistercanalsobeusedtodisabletheexternalinterruptfunction.
Comparator Interrupt
Thecomparatorinterruptiscontrolledbythetwointernalcomparators.Acomparatorinterrupt
requestwilltakeplacewhenthecomparatorinterruptrequestflags,CP0ForCP1F,areset,a
situationthatwilloccurwhenthecomparatoroutputbitchangesstate.Toallowtheprogramto
branchtoitsrespectiveinterruptvectoraddress,theglobalinterruptenablebit,EMI,andcomparator
interruptenablebits,CP0EandCP1E,mustrstbeset.Whentheinterruptisenabled,thestackis
notfullandthecomparatorinputsgenerateacomparatoroutputtransition,asubroutinecalltothe
comparatorinterruptvector,willtakeplace.Whentheinterruptisserviced,theexternalinterrupt
requestags,willbeautomaticallyresetandtheEMIbitwillbeautomaticallyclearedtodisable
otherinterrupts.
Multi-function Interrupt
WithinthesedevicesthereareuptosixMulti-functioninterrupts.Unliketheotherindependent
interrupts,theseinterruptshavenoindependentsource,butratherareformedfromotherexisting
interruptsources,namelytheTMInterrupts,SIMInterrupt,ExternalPeripheralInterrupt,LVD
interruptandEEPROMInterrupt.
AMulti-functioninterruptrequestwilltakeplacewhenanyoftheMulti-functioninterruptrequest
ags,MF0F~MF5Fareset.TheMulti-functioninterruptagswillbesetwhenanyoftheirincluded
functionsgenerateaninterruptrequestflag.Toallowtheprogramtobranchtoitsrespective
interruptvectoraddress,whentheMulti-functioninterruptisenabledandthestackisnotfull,and
eitheroneoftheinterruptscontainedwithineachofMulti-functioninterruptoccurs,asubroutine
calltooneoftheMulti-functioninterruptvectorswilltakeplace.Whentheinterruptisserviced,the
relatedMulti-Functionrequestag,willbeautomaticallyresetandtheEMIbitwillbeautomatically
clearedtodisableotherinterrupts.
However,itmustbenotedthat,althoughtheMulti-functionInterruptagswillbeautomatically
resetwhentheinterruptisserviced,therequestagsfromtheoriginalsourceoftheMulti-function
interrupts,namelytheTMInterrupts,SIMInterrupt,ExternalPeripheralInterrupt,LVDinterrupt
andEEPROMInterruptwillnotbeautomaticallyresetandmustbemanuallyresetbytheapplication
program.