Rev. 1.50 80 August 28, 2017 Rev. 1.50 81 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
Compact Type TM Operation 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
TnCCLRishighnoTMnPFinterruptrequestagwillbegenerated.IftheCCRAbitsareallzero,
thecounterwilloverowwhenitsreachesitsmaximum1-bit,FFFFHex,value,howeverherethe
TnAFinterruptrequestagwillnotbegenerated.
Asthenameofthemodesuggests,afteracomparisonismade,theTMnoutputpinwillchange
state.TheTMnoutputpinconditionhoweveronlychangesstatewhenaTnAFinterruptrequest
agisgeneratedafteracomparematchoccursfromComparatorA.TheTnPFinterruptrequestag,
generatedfromacomparematchoccursfromComparatorP,willhavenoeffectontheTMnoutput
pin.ThewayinwhichtheTMnoutputpinchangesstatearedeterminedbytheconditionofthe
TnIO1andTnIO0bitsintheTMnC1register.TheTMnoutputpincanbeselectedusingtheTnIO1
andTnIO0bitstogohigh,togolowortotogglefromitspresentconditionwhenacomparematch
occursfromComparatorA.TheinitialconditionoftheTMnoutputpin,whichissetupafterthe
TnONbitchangesfromlowtohigh,issetupusingtheTnOCbit.NotethatiftheTnIO1andTnIO0
bitsarezerothennopinchangewilltakeplace.