Rev. 2.50 110 June 22, 2017 Rev. 2.50 111 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
Programming Considerations
TheTMCounterRegistersandtheCapture/CompareCCRAandCCRBregisters,beingeither10-
bitor16-bit,allhavealowandhighbytestructure.Thehighbytescanbedirectlyaccessed,butas
thelowbytescanonlybeaccessedviaaninternal8-bitbuffer,readingorwritingtotheseregister
pairsmustbecarriedoutinaspecicway.Theimportantpointtonoteisthatdatatransfertoand
fromthe8-bitbufferanditsrelatedlowbyteonlytakesplacewhenawriteorreadoperationtoits
correspondinghighbyteisexecuted.
Data
Bus
8-bit
Buffer
TMxDHTMxDL
TMxBHTMxBL
TMxAHTMxAL
TM Counter Register (Read only)
TM CCRA Register (Read/Write)
TM CCRB Register (Read/Write)
AstheCCRAandCCRBregistersareimplementedinthewayshowninthefollowingdiagramand
accessingtheseregisterpairsiscarriedoutinaspecicwayasdescribedabove,itisrecommended
tousethe"MOV"instructiontoaccesstheCCRAandCCRBlowbyteregisters,namedTMxALand
TMxBL,usingthefollowingaccessprocedures.AccessingtheCCRAorCCRBlowbyteregisters
withoutfollowingtheseaccessprocedureswillresultinunpredictablevalues.
Thefollowingstepsshowthereadandwriteprocedures:
• WritingDatatoCCRBorCCRA
♦
Step1.WritedatatoLowByteTMxALorTMxBL
– notethatheredataisonlywrittentothe8-bitbuffer.
♦
Step2.WritedatatoHighByteTMxAHorTMxBH
– heredataiswrittendirectlytothehighbyteregistersandsimultaneouslydataislatched
fromthe8-bitbuffertotheLowByteregisters.
• ReadingDatafromtheCounterRegistersandCCRBorCCRA
♦
Step1.ReaddatafromtheHighByteTMxDH,TMxAHorTMxBH
– heredataisreaddirectlyfromtheHighByteregistersandsimultaneouslydataislatched
fromtheLowByteregisterintothe8-bitbuffer.
♦
Step2.ReaddatafromtheLowByteTMxDL,TMxALorTMxBL
– thisstepreadsdatafromthe8-bitbuffer.