Rev. 1.50 74 August 28, 2017 Rev. 1.50 75 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
Programming Considerations
TheTMCounterRegistersandtheCapture/CompareCCRAandCCRPregisters,beingeither10-
bitor16-bit,allhavealowandhighbytestructure.Thehighbytescanbedirectlyaccessed,butas
thelowbytescanonlybeaccessedviaaninternal8-bitbuffer,readingorwritingtotheseregister
pairsmustbecarriedoutinaspecicway.Theimportantpointtonoteisthatdatatransfertoand
fromthe8-bitbufferanditsrelatedlowbyteonlytakesplacewhenawriteorreadoperationtoits
correspondinghighbyteisexecuted.
AstheCCRAandCCRPregistersareimplementedinthewayshowninthefollowingdiagramand
accessingtheseregisterpairsiscarriedoutinaspecicwayasdescribedabove,itisrecommended
tousethe“MOV”instructiontoaccesstheCCRAandCCRPlowbyteregisters,namedTMnALand
TMnRPL,usingthefollowingaccessprocedures.AccessingtheCCRAorCCRPlowbyteregisters
withoutfollowingtheseaccessprocedureswillresultinunpredictablevalues.
Data Bus
8-bit Buffer
TMnDHTMnDL
TMnAH
TMnAL
TMn Counter Register (Read only)
TMn CCRA Register (Read/Write)
TMnRPHTMnRPL
PTM CCRP Register (Read/Write)
Thefollowingstepsshowthereadandwriteprocedures:
• WritingDatatoCCRAorCCRP
♦
Step1.WritedatatoLowByteTMnALorTMnRPL
– notethatheredataisonlywrittentothe8-bitbuffer.
♦
Step2.WritedatatoHighByteTMnAHorTMnRPH
– heredataiswrittendirectlytothehighbyteregistersandsimultaneouslydataislatched
fromthe8-bitbuffertotheLowByteregisters.
• ReadingDatafromtheCounterRegistersandCCRAorCCRP
♦
Step1.ReaddatafromtheHighByteTMnDH,TMnAHorTMnRPH
– heredataisreaddirectlyfromtheHighByteregistersandsimultaneouslydataislatched
fromtheLowByteregisterintothe8-bitbuffer.
♦
Step2.ReaddatafromtheLowByteTMnDL,TMnALorTMnRPL
– thisstepreadsdatafromthe8-bitbuffer.