Rev. 1.50 78 August 28, 2017 Rev. 1.50 79 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 TnDPX 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:Undened
10:PWMMode
11:Timer/CounterMode
ThesebitssetuptherequiredoperatingmodefortheTMn.Toensurereliableoperation
theTMnshouldbeswitchedoffbeforeanychangesaremadetotheTnM1andTnM0
bits.IntheTimer/CounterMode,theTMnoutputpincontrolwillbedisabled.
Bit5~4 TnIO1~TnIO0:SelectTPnpinoutputfunction
CompareMatchOutputMode
00:Nochange
01:Outputlow
10:Outputhigh
11:Toggleoutput
PWMOutputMode
00:PWMoutputinactivestate
01:PWMoutputactivestate
10:PWMoutput
11:Undened
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.ThePWMoutput
functionismodifiedbychangingthesetwobits.Itisnecessarytoonlychangethe
valuesoftheTnIO1andTnIO0bitsonlyaftertheTMnhasbeenswitchedoff.
UnpredictablePWMoutputswilloccuriftheTnIO1andTnIO0bitsarechangedwhen
theTMnisrunning.