Rev. 1.71 84 April 11, 2017 Rev. 1.71 85 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
Bit3 PTnON:PTMCounterOn/OffControl
0:Off
1:On
Thisbitcontrolstheoverallon/offfunctionoftheTM.Settingthebithighenablesthecounterto
run,clearingthebitdisablestheTM.Clearingthisbittozerowillstopthecounterfromcounting
andturnofftheTMwhichwillreduceitspowerconsumption.Whenthebitchangesstatefrom
lowtohightheinternalcountervaluewillberesettozero,howeverwhenthebitchangesfrom
hightolow,theinternalcounterwillretainitsresidualvalueuntilthebitreturnshighagain.
IftheTMisintheCompareMatchOutputModethentheTMoutputpinwillberesettoitsinitial
condition,asspeciedbytheTMOutputcontrolbit,whenthebitchangesfromlowtohigh.
Bit2~0 Unimplemented,readas“0”
PTMnC1 Register
Bit 7 6 5 4 3 2 1 0
Name PTnM1 PTnM0 PTnIO1 PTnIO0 PTnOC PTnPOL PTnCKS PTnCCLR
R/W R/W R/W R/W R/W R/W R/W R/W R/W
POR 0 0 0 0 0 0 0 0
Bit7~6 PTnM1~ PTnM0:SelectPTMOperationMode
00:CompareMatchOutputMode
01:CaptureInputMode
10:PWMModeorSinglePulseOutputMode
11:Timer/CounterMode
ThesebitssetuptherequiredoperatingmodefortheTM.ToensurereliableoperationtheTM
shouldbeswitchedoffbeforeanychangesaremadetothePTnM1andPTnM0bits.IntheTimer/
CounterMode,thePTMoutputpinstateisundened.
Bit5~4 PTnIO1~ PTnIO0:SelectPTMoutputfunction
CompareMatchOutputMode
00:Nochange
01:Outputlow
10:Outputhigh
11:Toggleoutput
PWMMode/SinglePulseOutputMode
00:PWMOutputinactivestate
01:PWMOutputactivestate
10:PWMoutput
11:Singlepulseoutput
CaptureInputMode
00:InputcaptureatrisingedgeofPTPnI
01:InputcaptureatfallingedgeofPTPnI
10:Inputcaptureatfalling/risingedgeofPTPnI
11:Inputcapturedisabled
Timer/counterMode
Unused
ThesetwobitsareusedtodeterminehowtheTMoutputpinchangesstatewhenacertain
conditionisreached.ThefunctionthatthesebitsselectdependsuponinwhichmodetheTMis
running.