Rev. 2.50 224 June 22, 2017 Rev. 2.50 225 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
Interrupt Wake-up Function
Eachoftheinterruptfunctionshasthecapabilityofwakingupthemicrocontrollerwheninthe
SLEEPorIDLEMode.Awake-upisgeneratedwhenaninterruptrequestagchangesfromlowto
highandisindependentofwhethertheinterruptisenabledornot.Therefore,eventhoughthedevice
isintheSLEEPorIDLEModeanditssystemoscillatorstopped,situationssuchasexternaledge
transitionsontheexternalinterruptpins,alowpowersupplyvoltageorcomparatorinputchange
maycausetheirrespectiveinterruptagtobesethighandconsequentlygenerateaninterrupt.Care
mustthereforebetakenifspuriouswake-upsituationsaretobeavoided.Ifaninterruptwake-up
functionistobedisabledthenthecorrespondinginterruptrequestagshouldbesethighbeforethe
deviceenterstheSLEEPorIDLEMode.Theinterruptenablebitshavenoeffectontheinterrupt
wake-upfunction.
Programming Considerations
Bydisablingtherelevantinterruptenablebits,arequestedinterruptcanbepreventedfrombeing
serviced,however,onceaninterruptrequestflagisset,itwillremaininthisconditioninthe
interruptregisteruntilthecorrespondinginterruptisservicedoruntiltherequestagisclearedby
theapplicationprogram.
WhereacertaininterruptiscontainedwithinaMulti-functioninterrupt,thenwhentheinterrupt
serviceroutineisexecuted,asonlytheMulti-functioninterruptrequestags,MF0F~MF5F,will
beautomaticallycleared,theindividualrequestflagforthefunctionneedstobeclearedbythe
applicationprogram.
ItisrecommendedthatprogramsdonotusetheCALLinstructionwithintheinterruptservice
subroutine.Interruptsoftenoccurinanunpredictablemannerorneedtobeservicedimmediately.
Ifonlyonestackisleftandtheinterruptisnotwellcontrolled,theoriginalcontrolsequencewillbe
damagedonceaCALLsubroutineisexecutedintheinterruptsubroutine.
EveryinterrupthasthecapabilityofwakingupthemicrocontrollerwhenitisinSLEEPorIDLE
Mode,thewakeupbeinggeneratedwhentheinterruptrequestagchangesfromlowtohigh.Ifitis
requiredtopreventacertaininterruptfromwakingupthemicrocontrollerthenitsrespectiverequest
agshouldberstsethighbeforeenterSLEEPorIDLEMode.
AsonlytheProgramCounterispushedontothestack,thenwhentheinterruptisserviced,ifthe
contentsoftheaccumulator,statusregisterorotherregistersarealteredbytheinterruptservice
program,theircontentsshouldbesavedtothememoryatthebeginningoftheinterruptservice
routine.
Toreturnfromaninterruptsubroutine,eitheraRETorRETIinstructionmaybeexecuted.TheRETI
instructioninadditiontoexecutingareturntothemainprogramalsoautomaticallysetstheEMI
bithightoallowfurtherinterrupts.TheRETinstructionhoweveronlyexecutesareturntothemain
programleavingtheEMIbitinitspresentzerostateandthereforedisablingtheexecutionoffurther
interrupts.