Rev. 2.50 130 June 22, 2017 Rev. 2.50 131 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
• TM2C1 Register – 16-bit STM
Bit 7 6 5 4 3 2 1 0
Name
T2M1 T2M0 T2IO1 T2IO0 T2OC T2POL T2DPX T2CCLR
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 T2M1~T2M0:SelectTM2OperatingMode
00:CompareMatchOutputMode
01:CaptureInputMode
10:PWMModeorSinglePulseOutputMode
11:Timer/CounterMode
ThesebitssetuptherequiredoperatingmodefortheTM.Toensurereliableoperation
theTMshouldbeswitchedoffbeforeanychangesaremadetotheT2M1andT2M0
bits.IntheTimer/CounterMode,theTMoutputpincontrolmustbedisabled.
Bit5~4 T2IO1~T2IO0:SelectTP2_0,TP2_1outputfunction
CompareMatchOutputMode
00:Nochange
01:Outputlow
10:Outputhigh
11:Toggleoutput
PWMMode/SinglePulseOutputMode
00:PWMoutputinactivestate
01:PWMoutputactivestate
10:PWMoutput
11:Singlepulseoutput
CaptureInputMode
00:InputcaptureatrisingedgeofTP2_0,TP2_1
01:InputcaptureatfallingedgeofTP2_0,TP2_1
10:Inputcaptureatfalling/risingedgeofTP2_0,TP2_1
11:Inputcapturedisabled
Timer/counterMode:
Unused
ThesetwobitsareusedtodeterminehowtheTMoutputpinchangesstatewhena
certainconditionisreached.Thefunctionthatthesebitsselectdependsuponinwhich
modetheTMisrunning.
IntheCompareMatchOutputMode,theT2IO1andT2IO0bitsdeterminehowthe
TMoutputpinchangesstatewhenacomparematchoccursfromtheComparatorA.
TheTMoutputpincanbesetuptoswitchhigh,switchlowortotoggleitspresent
statewhenacomparematchoccursfromtheComparatorA.Whenthebitsareboth
zero,thennochangewilltakeplaceontheoutput.TheinitialvalueoftheTMoutput
pinshouldbesetupusingtheT2OCbitintheTM2C1register.Notethattheoutput
levelrequestedbytheT2IO1andT2IO0bitsmustbedifferentfromtheinitialvalue
setupusingtheT2OCbitotherwisenochangewilloccurontheTMoutputpinwhen
acomparematchoccurs.AftertheTMoutputpinchangesstateitcanberesettoits
initiallevelbychangingtheleveloftheT2ONbitfromlowtohigh.
InthePWMMode,theT2IO1andT2IO0bitsdeterminehowtheTMoutputpin
changesstatewhenacertaincomparematchconditionoccurs.ThePWMoutput
functionismodiedbychangingthesetwobits.Itisnecessarytochangethevalues
oftheT2IO1andT2IO0bitsonlyaftertheTMhasbeenswitchedoff.Unpredictable
PWMoutputswilloccuriftheT2IO1andT2IO0bitsarechangedwhentheTMis
running.