Rev. 2.50 146 June 22, 2017 Rev. 2.50 147 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
• TM1C1 Register – 10-bit ETM
Bit 7 6 5 4 3 2 1 0
Name
T1AM1 T1AM0 T1AIO1 T1AIO0 T1AOC T1APOL T1CDN T1CCLR
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 T1AM1~T1AM0:SelectTM1CCRAOperatingMode
00:CompareMatchOutputMode
01:CaptureInputMode
10:PWMModeorSinglePulseOutputMode
11:Timer/CounterMode
ThesebitssetuptherequiredoperatingmodefortheTM.Toensurereliableoperation
theTMshouldbeswitchedoffbeforeanychangesaremadetotheT1AM1and
T1AM0bits.IntheTimer/CounterMode,theTMoutputpincontrolmustbedisabled.
Bit5~4 T1AIO1~T1AIO0:SelectTP1Aoutputfunction
CompareMatchOutputMode
00:Nochange
01:Outputlow
10:Outputhigh
11:Toggleoutput
PWMMode/SinglePulseOutputMode
00:PWMoutputinactivestate
01:PWMoutputactivestate
10:PWMoutput
11:Singlepulseoutput
CaptureInputMode
00:InputcaptureatrisingedgeofTP1A
01:InputcaptureatfallingedgeofTP1A
10:Inputcaptureatfalling/risingedgeofTP1A
11:Inputcapturedisabled
Timer/counterMode
Unused
ThesetwobitsareusedtodeterminehowtheTMoutputpinchangesstatewhena
certainconditionisreached.Thefunctionthatthesebitsselectdependsuponinwhich
modetheTMisrunning.
IntheCompareMatchOutputMode,theT1AIO1andT1AIO0bitsdeterminehow
theTMoutputpinchangesstatewhenacomparematchoccursfromtheComparator
A.TheTMoutputpincanbesetuptoswitchhigh,switchlowortotoggleitspresent
statewhenacomparematchoccursfromtheComparatorA.Whenthebitsareboth
zero,thennochangewilltakeplaceontheoutput.TheinitialvalueoftheTMoutput
pinshouldbesetupusingtheT1AOCbitintheTM1C1register.Notethattheoutput
levelrequestedbytheT1AIO1andT1AIO0bitsmustbedifferentfromtheinitial
valuesetupusingtheT1AOCbitotherwisenochangewilloccurontheTMoutputpin
whenacomparematchoccurs.AftertheTMoutputpinchangesstateitcanberesetto
itsinitiallevelbychangingtheleveloftheT1ONbitfromlowtohigh.
InthePWMMode,theT1AIO1andT1AIO0bitsdeterminehowtheTMoutputpin
changesstatewhenacertaincomparematchconditionoccurs.ThePWMoutput
functionismodiedbychangingthesetwobits.Itisnecessarytochangethevaluesof
theT1AIO1andT1AIO0bitsonlyaftertheTMhasbeenswitchedoff.Unpredictable
PWMoutputswilloccuriftheT1AIO1andT1AIO0bitsarechangedwhentheTMis
running.