EasyManua.ls Logo

Holtek HT66F002 - External Interrupt; Multi-function Interrupt; A;D Converter Interrupt

Default Icon
144 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.71 116 April 11, 2017 Rev. 1.71 117 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
External Interrupt
TheexternalinterruptiscontrolledbysignaltransitionsonthepinsINTandINT0~INT1.An
externalinterruptrequestwilltakeplacewhentheexternalinterruptrequestflag,INTnF,isset,
whichwilloccurwhenatransition,whosetypeischosenbytheedgeselectbits,appearsonthe
externalinterruptpin.Toallowtheprogramtobranchtotheinterruptvectoraddress,theglobal
interruptenablebit,EMI,andtheexternalinterruptenablebit,INTnE,mustrstbeset.Additionally
thecorrectinterruptedgetypemustbeselectedusingtheINTEGregistertoenabletheexternal
interruptfunctionandtochoosethetriggeredgetype.Astheexternalinterruptpinsarepin-shared
withI/Opins,theycanonlybeconfiguredasexternalinterruptpinsbysettingthepin-shared
registers.Thepinmustalsobesetupasaninputbysettingthecorrespondingbitintheportcontrol
register.Whentheinterruptisenabled,thestackisnotfullandthecorrecttransitiontypeappears
ontheexternalinterruptpin,asubroutinecalltotheexternalinterruptvector,willtakeplace.When
theinterruptisserviced,theexternalinterruptrequestflag,INTnF,willbeautomaticallyreset
andtheEMIbitwillbeautomaticallyclearedtodisableotherinterrupts.Notethatthepull-high
resistorselectionontheexternalinterruptpinwillremainvalidevenifthepinisusedasanexternal
interruptinput.
TheINTEGregisterisusedtoselectthetypeofactiveedgethatwilltriggertheexternalinterrupt.
Achoiceofeitherrisingorfallingorbothedgetypescanbechosentotriggeranexternalinterrupt.
NotethattheINTEGregistercanalsobeusedtodisabletheexternalinterruptfunction.
Multi-function Interrupt
WithinthesedevicesthereareuptotwoMulti-functioninterrupts.Unliketheotherindependent
interrupts,theseinterruptshavenoindependentsource,butratherareformedfromotherexisting
interruptsources,namelytheTMInterrupts.
AMulti-functioninterruptrequestwilltakeplacewhenanyoftheMulti-functioninterruptrequest
ags,MF0F~MF1Fareset.TheMulti-functioninterruptagswillbesetwhenanyoftheirincluded
functionsgenerateaninterruptrequestag.Toallowtheprogramtobranchtoitsrespectiveinterrupt
vectoraddress,whentheMulti-functioninterruptisenabledandthestackisnotfull,andeitherone
oftheinterruptscontainedwithineachofMulti-functioninterruptoccurs,asubroutinecalltooneof
theMulti-functioninterruptvectorswilltakeplace.Whentheinterruptisserviced,therelatedMulti-
Functionrequestag,willbeautomaticallyresetandtheEMIbitwillbeautomaticallyclearedto
disableotherinterrupts.
However,itmustbenotedthat,althoughtheMulti-functionInterruptagswillbeautomatically
resetwhentheinterruptisserviced,therequestagsfromtheoriginalsourceoftheMulti-function
interrupts,namelytheTMInterrupts,willnotbeautomaticallyresetandmustbemanuallyresetby
theapplicationprogram.
A/D Converter Interrupt
ThedevicescontainanA/Dconverterwhichhasitsownindependentinterrupt.TheA/DConverter
InterruptiscontrolledbytheterminationofanA/Dconversionprocess.AnA/DConverterInterrupt
requestwilltakeplacewhentheA/DConverterInterruptrequestag,ADF,isset,whichoccurs
whentheA/Dconversionprocessnishes.Toallowtheprogramtobranchtoitsrespectiveinterrupt
vectoraddress,theglobalinterruptenablebit,EMI,andA/DInterruptenablebit,ADE,mustrstbe
set.Whentheinterruptisenabled,thestackisnotfullandtheA/Dconversionprocesshasended,a
subroutinecalltotheA/DConverterInterruptvector,willtakeplace.Whentheinterruptisserviced,
theA/DConverterInterruptflag,ADF,willbeautomaticallycleared.TheEMIbitwillalsobe
automaticallyclearedtodisableotherinterrupts.

Table of Contents

Related product manuals