Rev. 1.50 106 August 28, 2017 Rev. 1.50 107 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
TMnC1 Register
Bit 7 6 5 4 3 2 1 0
Name TnM1 TnM0 TnIO1 TnIO0 TnOC TnPOL TnCAPTS TnCCLR
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 TnM1~TnM0:SelectTMnOperatingMode
00:CompareMatchOutputMode
01:CaptureInputMode
10:PWMModeorSinglePulseOutputMode
11:Timer/CounterMode
ThesebitssetuptherequiredoperatingmodefortheTMn.Toensurereliableoperation
theTMnshouldbeswitchedoffbeforeanychangesaremadetotheTnM1andTnM0
bits.IntheTimer/CounterMode,theTMnoutputpincontrolwillbedisabled.
Bit5~4 TnIO1~TnIO0:SelectTPnoutputfunction
CompareMatchOutputMode
00:Nochange
01:Outputlow
10:Outputhigh
11:Toggleoutput
PWMOutputMode/SinglePulseOutputMode
00:PWMoutputinactivestate
01:PWMoutputactivestate
10:PWMoutput
11:SinglePulseOutput
CaptureInputMode
00:InputcaptureatrisingedgeofTPnorTCKn
01:InputcaptureatfallingedgeofTPnorTCKn
10:Inputcaptureatrising/fallingedgeofTPnorTCKn
11:Inputcapturedisabled
Timer/CounterMode
Unused
ThesetwobitsareusedtodeterminehowtheTMnoutputpinchangesstatewhena
certainconditionisreached.Thefunctionthatthesebitsselectdependsuponinwhich
modetheTMnisrunning.
IntheCompareMatchOutputMode,theTnIO1andTnIO0bitsdeterminehowthe
TMnoutputpinchangesstatewhenacomparematchoccursfromtheComparatorA.
TheTMnoutputpincanbesetuptoswitchhigh,switchlowortotoggleitspresent
statewhenacomparematchoccursfromtheComparatorA.Whenthebitsareboth
zero,thennochangewilltakeplaceontheoutput.TheinitialvalueoftheTMnoutput
pinshouldbesetupusingtheTnOCbitintheTMnC1register.Notethattheoutput
levelrequestedbytheTnIO1andTnIO0bitsmustbedifferentfromtheinitialvalue
setupusingtheTnOCbitotherwisenochangewilloccurontheTMnoutputpinwhen
acomparematchoccurs.AftertheTMnoutputpinchangesstate,itcanberesettoits
initiallevelbychangingtheleveloftheTnONbitfromlowtohigh.
InthePWMMode,theTnIO1andTnIO0bitsdeterminehowtheTMnoutputpin
changesstatewhenacertaincomparematchconditionoccurs.TheTMnoutput
functionismodifiedbychangingthesetwobits.Itisnecessarytoonlychangethe
valuesoftheTnIO1andTnIO0bitsonlyaftertheTMnhasbeenswitchedoff.
UnpredictablePWMoutputswilloccuriftheTnIO1andTnIO0bitsarechangedwhen
theTMnisrunning.