Rev. 2.50 116 June 22, 2017 Rev. 2.50 117 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
Compact Type TM Operating Modes
TheCompactTypeTMcanoperateinoneofthreeoperatingmodes,CompareMatchOutputMode,
PWMModeorTimer/CounterMode.TheoperatingmodeisselectedusingtheTnM1andTnM0
bitsintheTMnC1register.
Compare Match Output Mode
Toselectthismode,bitsTnM1andTnM0intheTMnC1register,shouldbesetto"00"respectively.
Inthismodeoncethecounterisenabledandrunningitcanbeclearedbythreemethods.Theseare
acounteroverow,acomparematchfromComparatorAandacomparematchfromComparatorP.
WhentheTnCCLRbitislow,therearetwowaysinwhichthecountercanbecleared.Oneiswhen
acomparematchoccursfromComparatorP,theotheriswhentheCCRPbitsareallzerowhich
allowsthecountertooverow.HerebothTnAFandTnPFinterruptrequestagsfortheComparator
AandComparatorPrespectively,willbothbegenerated.
IftheTnCCLRbitintheTMnC1registerishighthenthecounterwillbeclearedwhenacompare
matchoccursfromComparatorA.However,hereonlytheTnAFinterruptrequestflagwillbe
generatedevenifthevalueoftheCCRPbitsislessthanthatoftheCCRAregisters.Thereforewhen
TnCCLRishighnoTnPFinterruptrequestagwillbegenerated.IftheCCRAbitsareallzero,the
counterwilloverowwhenitsreachesitsmaximum10-bit,3FFHex,value,howeverheretheTnAF
interruptrequestagwillnotbegenerated.
Asthenameofthemodesuggests,afteracomparisonismade,theTMoutputpinwillchangestate.
TheTMoutputpinconditionhoweveronlychangesstatewhenanTnAFinterruptrequestflag
isgeneratedafteracomparematchoccursfromComparatorA.TheTnPFinterruptrequestflag,
generatedfromacomparematchoccursfromComparatorP,willhavenoeffectontheTMoutput
pin.ThewayinwhichtheTMoutputpinchangesstatearedeterminedbytheconditionofthe
TnIO1andTnIO0bitsintheTMnC1register.TheTMoutputpincanbeselectedusingtheTnIO1
andTnIO0bitstogohigh,togolowortotogglefromitspresentconditionwhenacomparematch
occursfromComparatorA.TheinitialconditionoftheTMoutputpin,whichissetupafterthe
TnONbitchangesfromlowtohigh,issetupusingtheTnOCbit.NotethatiftheTnIO1andTnIO0
bitsarezerothennopinchangewilltakeplace.
Timer/Counter Mode
Toselectthismode,bitsTnM1andTnM0intheTMnC1registershouldbesetto11respectively.
TheTimer/CounterModeoperatesinanidenticalwaytotheCompareMatchOutputMode
generatingthesameinterruptags.TheexceptionisthatintheTimer/CounterModetheTMoutput
pinisnotused.ThereforetheabovedescriptionandTimingDiagramsfortheCompareMatch
OutputModecanbeusedtounderstanditsfunction.AstheTMoutputpinisnotusedinthismode,
thepincanbeusedasanormalI/Opinorotherpin-sharedfunction.