Rev. 1.50 180 August 28, 2017 Rev. 1.50 181 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
External Interrupt
TheexternalinterruptsarecontrolledbysignaltransitionsonthepinsINT0~INT1.Anexternal
interruptrequestwilltakeplacewhentheexternalinterruptrequestags,INT0F~INT1F,areset,
whichwilloccurwhenatransition,whosetypeischosenbytheedgeselectbits,appearsonthe
externalinterruptpins.Toallowtheprogramtobranchtoitsrespectiveinterruptvectoraddress,
theglobalinterruptenablebit,EMI,andrespectiveexternalinterruptenablebit,INT0E~INT1E,
mustfirstbeset.AdditionallythecorrectinterruptedgetypemustbeselectedusingtheINTEG
registertoenabletheexternalinterruptfunctionandtochoosethetriggeredgetype.Astheexternal
interruptpinsarepin-sharedwithI/Opins,theycanonlybeconguredasexternalinterruptpinsif
theirexternalinterruptenablebitinthecorrespondinginterruptregisterhasbeensetandtheexternal
interruptpinisselectedbythecorrespondingpin-sharedfunctionselectionbits.Thepinmustalso
besetupasaninputbysettingthecorrespondingbitintheportcontrolregister.Whentheinterrupt
isenabled,thestackisnotfullandthecorrecttransitiontypeappearsontheexternalinterruptpin,
asubroutinecalltotheexternalinterruptvector,willtakeplace.Whentheinterruptisserviced,the
externalinterruptrequestags,INT0F~INT1F,willbeautomaticallyresetandtheEMIbitwillbe
automaticallyclearedtodisableotherinterrupts.Notethatanypull-highresistorselectionsonthe
externalinterruptpinswillremainvalidevenifthepinisusedasanexternalinterruptinput.
TheINTEGregisterisusedtoselectthetypeofactiveedgethatwilltriggertheexternalinterrupt.
Achoiceofeitherrisingorfallingorbothedgetypescanbechosentotriggeranexternalinterrupt.
NotethattheINTEGregistercanalsobeusedtodisabletheexternalinterruptfunction.
Comparator Interrupt – HT66F0185
Thecomparatorinterruptiscontrolledbytheinternalcomparator.Acomparatorinterruptrequest
willtakeplacewhenthecomparatorinterruptrequestag,CPF,isset,asituationthatwilloccur
whenthecomparatoroutputchangesstate.Toallowtheprogramtobranchtoitsrespectiveinterrupt
vectoraddress,theglobalinterruptenablebit,EMI,andcomparatorinterruptenablebit,CPE,must
rstbeset.Whentheinterruptisenabled,thestackisnotfullandthecomparatorinputsgenerate
acomparatoroutputtransition,asubroutinecalltothecomparatorinterruptvector,willtakeplace.
Whentheinterruptisserviced,thecomparatorinterruptrequestag,willbeautomaticallyresetand
theEMIbitwillbeautomaticallyclearedtodisableotherinterrupts.
Multi-function Interrupt
WithinthedevicethereareuptothreeMulti-functioninterrupts.Unliketheotherindependent
interrupts,theseinterruptshavenoindependentsource,butratherareformedfromotherexisting
interruptsources,namelytheTMinterrupts,LVDinterruptandEEPROMwriteoperationinterrupt.
AMulti-functioninterruptrequestwilltakeplacewhenanyoftheMulti-functioninterruptrequest
flagsMFnFareset.TheMulti-functioninterruptflagswillbesetwhenanyoftheirincluded
functionsgenerateaninterruptrequestag.Toallowtheprogramtobranchtoitsrespectiveinterrupt
vectoraddress,whentheMulti-functioninterruptisenabledandthestackisnotfull,andeitherone
oftheinterruptscontainedwithineachofMulti-functioninterruptoccurs,asubroutinecalltooneof
theMulti-functioninterruptvectorswilltakeplace.Whentheinterruptisserviced,therelatedMulti-
FunctionrequestagwillbeautomaticallyresetandtheEMIbitwillbeautomaticallyclearedto
disableotherinterrupts.
However,itmustbenotedthat,althoughtheMulti-functionInterruptrequestflagswillbe
automaticallyresetwhentheinterruptisserviced,therequestflagsfromtheoriginalsourceof
theMulti-functioninterruptswillnotbeautomaticallyresetandmustbemanuallyresetbythe
applicationprogram.