User`s guide
Rev. 1.10 16 November 14, 2014 Rev. 1.10 17 November 14, 2014
HT66FW2230
Wireless Charger A/D Flash 8-Bit MCU
Instruction Fetching
Program Counter
Duringprogramexecution,theProgramCounterisusedtokeeptrackoftheaddressofthe
nextinstructiontobeexecuted.Itisautomaticallyincrementedbyoneeachtimeaninstruction
isexecutedexceptforinstructions,suchas“JMP”or“CALL”thatdemandajumptoanon-
consecutiveProgramMemoryaddress.Onlythelower8bits,knownastheProgramCounterLow
Register,aredirectlyaddressablebytheapplicationprogram.
Whenexecutinginstructionsrequiringjumpstonon-consecutiveaddressessuchasajump
instruction,asubroutinecall,interruptorreset,etc.,themicrocontrollermanagesprogramcontrol
byloadingtherequiredaddressintotheProgramCounter.Forconditionalskipinstructions,once
theconditionhasbeenmet,thenextinstruction,whichhasalreadybeenfetchedduringthepresent
instructionexecution,isdiscardedandadummycycletakesitsplacewhilethecorrectinstructionis
obtained.
Program Counter
Program Counter High byte PCL Register
PC11~PC8 PCL7~PCL0
ThelowerbyteoftheProgramCounter,knownastheProgramCounterLowregisterorPCL,is
availableforprogramcontrolandisareadableandwriteableregister.Bytransferringdatadirectly
intothisregister,ashortprogramjumpcanbeexecuteddirectly,however,asonlythislowbyte
isavailableformanipulation,thejumpsarelimitedtothepresentpageofmemory,thatis256
locations.Whensuchprogramjumpsareexecuteditshouldalsobenotedthatadummycycle
willbeinserted.ManipulatingthePCLregistermaycauseprogrambranching,soanextracycleis
neededtopre-fetch.
Stack
ThisisaspecialpartofthememorywhichisusedtosavethecontentsoftheProgramCounter
only.Thestackisneitherpartofthedatanorpartoftheprogramspace,andisneitherreadablenor
writeable.TheactivatedlevelisindexedbytheStackPointer,andisneitherreadablenorwriteable.
Atasubroutinecallorinterruptacknowledgesignal,thecontentsoftheProgramCounterarepushed
ontothestack.Attheendofasubroutineoraninterruptroutine,signaledbyareturninstruction,
RETorRETI,theProgramCounterisrestoredtoitspreviousvaluefromthestack.Afteradevice
reset,theStackPointerwillpointtothetopofthestack.
Ifthestackisfullandanenabledinterrupttakesplace,theinterruptrequestagwillberecorded
buttheacknowledgesignalwillbeinhibited.WhentheStackPointerisdecremented,byRETor
RETI,theinterruptwillbeserviced.Thisfeaturepreventsstackoverowallowingtheprogrammer
tousethestructuremoreeasily.However,whenthestackisfull,aCALLsubroutineinstructioncan
stillbeexecutedwhichwillresultinastackoverow.Precautionsshouldbetakentoavoidsuch
caseswhichmightcauseunpredictableprogrambranching.Ifthestackisoverow,therstProgram
Countersaveinthestackwillbelost.