Rev. 1.50 188 August 28, 2017 Rev. 1.50 189 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
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-bitoutput
port,manipulatetheinputdatatoensurethatotherbitsarenotchangedandthenoutputtheportwith
thecorrectnewdata.Thisread-modify-writeprocessistakencareofautomaticallywhenthesebit
operationinstructionsareused.
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.