Rev. 1.50 184 August 28, 2017 Rev. 1.50 185 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
Interrupt Wake-up Function
Eachoftheinterruptfunctionshasthecapabilityofwakingupthemicrocontrollerwheninthe
SLEEPorIDLEMode.Awake-upisgeneratedwhenaninterruptrequestagchangesfromlow
tohighandisindependentofwhethertheinterruptisenabledornot.Therefore,eventhoughthese
devicesareintheSLEEPorIDLEModeanditssystemoscillatorstopped,situationssuchas
externaledgetransitionsontheexternalinterruptpins,alowpowersupplyvoltageorcomparator
inputchangemaycausetheirrespectiveinterruptflagtobesethighandconsequentlygenerate
aninterrupt.Caremustthereforebetakenifspuriouswake-upsituationsaretobeavoided.Ifan
interruptwake-upfunctionistobedisabledthenthecorrespondinginterruptrequestagshouldbe
sethighbeforethedeviceenterstheSLEEPorIDLEMode.Theinterruptenablebitshavenoeffect
ontheinterruptwake-upfunction.
Programming Considerations
Bydisablingtherelevantinterruptenablebits,arequestedinterruptcanbepreventedfrombeing
serviced,however,onceaninterruptrequestflagisset,itwillremaininthisconditioninthe
interruptregisteruntilthecorrespondinginterruptisservicedoruntiltherequestagisclearedby
theapplicationprogram.
WhereacertaininterruptiscontainedwithinaMulti-functioninterrupt,thenwhentheinterrupt
serviceroutineisexecuted,asonlytheMulti-functioninterruptrequestflags,MFnF,willbe
automaticallycleared,theindividualrequestflagforthefunctionneedstobeclearedbythe
applicationprogram.
Itisrecommendedthatprogramsdonotusethe“CALL”instructionwithintheinterruptservice
subroutine.Interruptsoftenoccurinanunpredictablemannerorneedtobeservicedimmediately.
Ifonlyonestackisleftandtheinterruptisnotwellcontrolled,theoriginalcontrolsequencewillbe
damagedonceaCALLsubroutineisexecutedintheinterruptsubroutine.
EveryinterrupthasthecapabilityofwakingupthemicrocontrollerwhenitisintheSLEEPorIDLE
Mode,thewakeupbeinggeneratedwhentheinterruptrequestagchangesfromlowtohigh.Ifitis
requiredtopreventacertaininterruptfromwakingupthemicrocontrollerthenitsrespectiverequest
agshouldberstsethighbeforeenterSLEEPorIDLEMode.
AsonlytheProgramCounterispushedontothestack,thenwhentheinterruptisserviced,ifthe
contentsoftheaccumulator,statusregisterorotherregistersarealteredbytheinterruptservice
program,theircontentsshouldbesavedtothememoryatthebeginningoftheinterruptservice
routine.
Toreturnfromaninterruptsubroutine,eitheraRETorRETIinstructionmaybeexecuted.TheRETI
instructioninadditiontoexecutingareturntothemainprogramalsoautomaticallysetstheEMI
bithightoallowfurtherinterrupts.TheRETinstructionhoweveronlyexecutesareturntothemain
programleavingtheEMIbitinitspresentzerostateandthereforedisablingtheexecutionoffurther
interrupts.