Rev. 2.50 100 June 22, 2017 Rev. 2.50 101 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
EachdeviceintheseriescontainsaspecicnumberofeitherCompactType,StandardTypeand
EnhancedTypeTMunitswhichareshowninthetabletogetherwiththeirindividualreferencename,
TM0~TM3.
Device TM0 TM1 TM2 TM3
HT66F20
10-bit CTM 10-bit STM — —
HT66F30
10-bit CTM 10-bit ETM — —
HT66F40
10-bit CTM 10-bit ETM 16-bit STM —
HT66F50
10-bit CTM 10-bit ETM 16-bit STM 10-bit CTM
HT66F60 10-bit CTM 10-bit ETM 16-bit STM 10-bit CTM
TM Name/Type Reference
TM Operation
ThethreedifferenttypesofTMofferadiverserangeoffunctions,fromsimpletimingoperations
toPWMsignalgeneration.ThekeytounderstandinghowtheTMoperatesistoseeitintermsof
afreerunningcounterwhosevalueisthencomparedwiththevalueofpre-programmedinternal
comparators.Whenthefreerunningcounterhasthesamevalueasthepre-programmedcomparator,
knownasacomparematchsituation,aTMinterruptsignalwillbegeneratedwhichcanclearthe
counterandperhapsalsochangetheconditionoftheTMoutputpin.TheinternalTMcounteris
drivenbyauserselectableclocksource,whichcanbeaninternalclockoranexternalpin.
TM Clock Source
TheclocksourcewhichdrivesthemaincounterineachTMcanoriginatefromvarioussources.
TheselectionoftherequiredclocksourceisimplementedusingtheTnCK2~TnCK0bitsintheTM
controlregisters.Theclocksourcecanbearatioofeitherthesystemclockf
SYS
ortheinternalhigh
clockf
H
,thef
TBC
clocksourceortheexternalTCKnpin.Notethatsettingthesebitstothevalue101
willselectareservedclockinput,ineffectdisconnectingtheTMclocksource.TheTCKnpinclock
sourceisusedtoallowanexternalsignaltodrivetheTMasanexternalclocksourceorforevent
counting.
TM Interrupts
TheCompactandStandardtypeTMseachhavetwointernalinterrupts,oneforeachoftheinternal
comparatorAorcomparatorP,whichgenerateaTMinterruptwhenacomparematchcondition
occurs.AstheEnhancedtypeTMhasthreeinternalcomparatorsandcomparatorAorcomparator
BorcomparatorPcomparematchfunctions,itconsequentlyhasthreeinternalinterrupts.Whena
TMinterruptisgenerateditcanbeusedtoclearthecounterandalsotochangethestateoftheTM
outputpin.