Rev. 2.50 148 June 22, 2017 Rev. 2.50 149 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
• TM1C2 Register – 10-bit ETM
Bit 7 6 5 4 3 2 1 0
Name
T1BM1 T1BM0 T1BIO1 T1BIO0 T1BOC T1BPOL T1PWM1 T1PWM0
R/W R/W R/W R/W R/W R/W R/W R R/W
POR 0 0 0 0 0 0 0 0
Bit7~6 T1BM1~T1BM0:SelectTM1CCRBOperatingMode
00:CompareMatchOutputMode
01:CaptureInputMode
10:PWMModeorSinglePulseOutputMode
11:Timer/Countermode
ThesebitssetuptherequiredoperatingmodefortheTM.Toensurereliableoperation
theTMshouldbeswitchedoffbeforeanychangesaremadetotheT1BM1and
T1BM0bits.IntheTimer/CounterMode,theTMoutputpincontrolmustbedisabled.
Bit5~4 T1BIO1~T1BIO0:SelectTP1B_0,TP1B_1,TP1B_2outputfunction
CompareMatchOutputMode
00:Nochange
01:Outputlow
10:Outputhigh
11:Toggleoutput
PWMMode/SinglePulseOutputMode
00:PWMoutputinactivestate
01:PWMoutputactivestate
10:PWMoutput
11:Singlepulseoutput
CaptureInputMode
00:InputcaptureatrisingedgeofTP1B_0,TP1B_1,TP1B_2
01:InputcaptureatfallingedgeofTP1B_0,TP1B_1,TP1B_2
10:Inputcaptureatfalling/risingedgeofTP1B_0,TP1B_1,TP1B_2
11:Inputcapturedisabled
Timer/counterMode
Unused
ThesetwobitsareusedtodeterminehowtheTMoutputpinchangesstatewhena
certainconditionisreached.Thefunctionthatthesebitsselectdependsuponinwhich
modetheTMisrunning.
IntheCompareMatchOutputMode,theT1BIO1andT1BIO0bitsdeterminehowthe
TMoutputpinchangesstatewhenacomparematchoccursfromtheComparatorB.
TheTMoutputpincanbesetuptoswitchhigh,switchlowortotoggleitspresent
statewhenacomparematchoccursfromtheComparatorB.Whenthebitsareboth
zero,thennochangewilltakeplaceontheoutput.TheinitialvalueoftheTMoutput
pinshouldbesetupusingtheT1BOCbitintheTM1C2register.Notethattheoutput
levelrequestedbytheT1BIO1andT1BIO0bitsmustbedifferentfromtheinitial
valuesetupusingtheT1BOCbitotherwisenochangewilloccurontheTMoutputpin
whenacomparematchoccurs.AftertheTMoutputpinchangesstateitcanberesetto
itsinitiallevelbychangingtheleveloftheT1ONbitfromlowtohigh.
InthePWMMode,theT1BIO1andT1BIO0bitsdeterminehowtheTMoutputpin
changesstatewhenacertaincomparematchconditionoccurs.ThePWMoutput
functionismodiedbychangingthesetwobits.Itisnecessarytochangethevaluesof
theT1BIO1andT1BIO0bitsonlyaftertheTMhasbeenswitchedoff.Unpredictable
PWMoutputswilloccuriftheT1BIO1andT1BIO0bitsarechangedwhentheTMis
running.