User`s guide
Rev. 1.10 134 November 14, 2014 Rev. 1.10 135 November 14, 2014
HT66FW2230
Wireless Charger A/D Flash 8-Bit MCU
Logical and Rotate Operation
ThestandardlogicaloperationssuchasAND,OR,XORandCPLallhavetheirowninstruction
withintheHoltekmicrocontrollerinstructionset.Aswiththecaseofmostinstructionsinvolving
datamanipulation,datamustpassthroughtheAccumulatorwhichmayinvolveadditional
programmingsteps.Inalllogicaldataoperations,thezeroflagmaybesetiftheresultofthe
operationiszero.Anotherformoflogicaldatamanipulationcomesfromtherotateinstructionssuch
asRR,RL,RRCandRLCwhichprovideasimplemeansofrotatingonebitrightorleft.Different
rotateinstructionsexistdependingonprogramrequirements.Rotateinstructionsareusefulforserial
portprogrammingapplicationswheredatacanberotatedfromaninternalregisterintotheCarry
bitfromwhereitcanbeexaminedandthenecessaryserialbitsethighorlow.Anotherapplication
whichrotatedataoperationsareusedistoimplementmultiplicationanddivisioncalculations.
Branches and Control Transfer
ProgrambranchingtakestheformofeitherjumpstospeciedlocationsusingtheJMPinstruction
ortoasubroutineusingtheCALLinstruction.Theydifferinthesensethatinthecaseofa
subroutinecall,theprogrammustreturntotheinstructionimmediatelywhenthesubroutinehas
beencarriedout.Thisisdonebyplacingareturninstruction"RET"inthesubroutinewhichwill
causetheprogramtojumpbacktotheaddressrightaftertheCALLinstruction.InthecaseofaJMP
instruction,theprogramsimplyjumpstothedesiredlocation.Thereisnorequirementtojumpback
totheoriginaljumpingoffpointasinthecaseoftheCALLinstruction.Onespecialandextremely
usefulsetofbranchinstructionsaretheconditionalbranches.Hereadecisionisrstmaderegarding
theconditionofacertaindatamemoryorindividualbits.Dependingupontheconditions,the
programwillcontinuewiththenextinstructionorskipoveritandjumptothefollowinginstruction.
Theseinstructionsarethekeytodecisionmakingandbranchingwithintheprogramperhaps
determinedbytheconditionofcertaininputswitchesorbytheconditionofinternaldatabits.
Bit Operations
TheabilitytoprovidesinglebitoperationsonDataMemoryisanextremelyexiblefeatureofall
Holtekmicrocontrollers.Thisfeatureisespeciallyusefulforoutputportbitprogrammingwhere
individualbitsorportpinscanbedirectlysethighorlowusingeitherthe"SET[m].i"or"CLR[m].
i"instructionsrespectively.Thefeatureremovestheneedforprogrammerstorstreadthe8-bit
outputport,manipulatetheinputdatatoensurethatotherbitsarenotchangedandthenoutputthe
portwiththecorrectnewdata.Thisread-modify-writeprocessistakencareofautomaticallywhen
thesebitoperationinstructionsareused.
Table Read Operations
Datastorageisnormallyimplementedbyusingregisters.However,whenworkingwithlarge
amountsofxeddata,thevolumeinvolvedoftenmakesitinconvenienttostorethexeddatain
theDataMemory.Toovercomethisproblem,HoltekmicrocontrollersallowanareaofProgram
Memorytobesetupasatablewheredatacanbedirectlystored.Asetofeasytouseinstructions
providesthemeansbywhichthisfixeddatacanbereferencedandretrievedfromtheProgram
Memory.
Other Operations
Inadditiontotheabovefunctionalinstructions,arangeofotherinstructionsalsoexistsuchas
the"HALT"instructionforPower-downoperationsandinstructionstocontroltheoperationof
theWatchdogTimerforreliableprogramoperationsunderextremeelectricorelectromagnetic
environments.Fortheirrelevantoperations,refertothefunctionalrelatedsections.