EasyManua.ls Logo

Holtek HT66F002 - Programming Considerations (TM)

Default Icon
144 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Rev. 1.71 68 April 11, 2017 Rev. 1.71 69 April 11, 2017
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
PTM
PTPn
PTCKn
Capture Input
TCK Input
Output
PTPnI
PTPnB
Inverting Output
PTM Function Pin Control Block Diagram
Programming Considerations
TheTMCounterRegistersandtheCapture/CompareCCRAregister,andCCRPregisterpairfor
PeriodicTimerModule,allhavealowandhighbytestructure.Thehighbytescanbedirectly
accessed,butasthelowbytescanonlybeaccessedviaaninternal8-bitbuffer,readingorwriting
totheseregisterpairsmustbecarriedoutinaspecicway.Theimportantpointtonoteisthatdata
transfertoandfromthe8-bitbufferanditsrelatedlowbyteonlytakesplacewhenawriteorread
operationtoitscorrespondinghighbyteisexecuted.
AstheCCRAregisterandCCRPregistersareimplementedintheway showninthefollowing
diagramandaccessingtheregisteriscarriedoutCCRP low byte register using thefollowing
accessprocedures.AccessingtheCCRAorCCRPlowbyteregisterwithoutfollowingtheseaccess
procedureswillresultinunpredictablevalues.
8-bit Buffer
PTMnDHPTMnDL
PTMnRPHPTMnRPL
PTMnAH
PTMnAL
PTM Counter Register (Read only)
PTM CCRA Register (Read/Write)
PTM CCRP Register (Read/Write)
Data Bus
8-bit Buffer
STMDH
STMDL
STM0AHSTM0AL
STM Counter Register (Read only)
STM CCRA Register (Read/Write)
Data Bus
Thefollowingstepsshowthereadandwriteprocedures:
• WritingDatatoCCRAorPTMCCRP
Step1.WritedatatoLowByteSTM0ALPTMnALorPTMnRPL
notethatheredataisonlywrittentothe8-bitbuffer.
Step2.WritedatatoHighByteSTM0AHPTMnAHorPTMnRPH
heredataiswrittendirectlytothehighbyteregistersandsimultaneouslydataislatched
fromthe8-bitbuffertotheLowByteregisters.
• ReadingDatafromtheCounterRegistersandCCRAorPTMCCRP
Step1.ReaddatafromtheHighByteSTM0DH,STM0AHPTMnDH,PTMnAHorPTMnRPH
heredataisreaddirectlyfromtheHighByteregistersandsimultaneouslydataislatched
fromtheLowByteregisterintothe8-bitbuffer.
Step2.ReaddatafromtheLowByteSTM0DL,STM0ALPTMnDL,PTMnALorPTMnRPL
thisstepreadsdatafromthe8-bitbuffer.

Table of Contents

Related product manuals