Rev. 2.50 114 June 22, 2017 Rev. 2.50 115 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
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
ThesebitssetuptherequiredoperatingmodefortheTM.Toensurereliableoperation
theTMshouldbeswitchedoffbeforeanychangesaremadetotheTnM1andTnM0
bits.IntheTimer/CounterMode,theTMoutputpincontrolmustbedisabled.
Bit5~4 TnIO1~TnIO0:SelectTPn_0,TPn_1outputfunction
CompareMatchOutputMode
00:Nochange
01:Outputlow
10:Outputhigh
11:Toggleoutput
PWMMode
00:PWMoutputinactivestate
01:PWMoutputactivestate
10:PWMoutput
11:Undened
Timer/counterMode
Unused
ThesetwobitsareusedtodeterminehowtheTMoutputpinchangesstatewhena
certainconditionisreached.Thefunctionthatthesebitsselectdependsuponinwhich
modetheTMisrunning.
IntheCompareMatchOutputMode,theTnIO1andTnIO0bitsdeterminehowthe
TMoutputpinchangesstatewhenacomparematchoccursfromtheComparatorA.
TheTMoutputpincanbesetuptoswitchhigh,switchlowortotoggleitspresent
statewhenacomparematchoccursfromtheComparatorA.Whenthebitsareboth
zero,thennochangewilltakeplaceontheoutput.TheinitialvalueoftheTMoutput
pinshouldbesetupusingtheTnOCbitintheTMnC1register.Notethattheoutput
levelrequestedbytheTnIO1andTnIO0bitsmustbedifferentfromtheinitialvalue
setupusingtheTnOCbitotherwisenochangewilloccurontheTMoutputpinwhen
acomparematchoccurs.AftertheTMoutputpinchangesstateitcanberesettoits
initiallevelbychangingtheleveloftheTnONbitfromlowtohigh.
InthePWMMode,theTnIO1andTnIO0bitsdeterminehowtheTMoutputpin
changesstatewhenacertaincomparematchconditionoccurs.ThePWMoutput
functionismodiedbychangingthesetwobits.Itisnecessarytochangethevalues
oftheTnIO1andTnIO0bitsonlyaftertheTMnhasbeenswitchedoff.Unpredictable
PWMoutputswilloccuriftheTnIO1andTnIO0bitsarechangedwhentheTMis
running.