Rev. 1.50 108 August 28, 2017 Rev. 1.50 109 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
Periodic Type TM Operation Modes
ThePeriodicTypeTMcanoperateinoneofveoperatingmodes,CompareMatchOutputMode,
PWMOutputMode,SinglePulseOutputMode,CaptureInputModeorTimer/CounterMode.The
operatingmodeisselectedusingtheTnM1andTnM0bitsintheTMnC1register.
Compare Match Output Mode
Toselectthismode,bitsTnM1andTnM0intheTMnC1register,shouldbesetto00respectively.
Inthismodeoncethecounterisenabledandrunningitcanbeclearedbythreemethods.Theseare
acounteroverow,acomparematchfromComparatorAandacomparematchfromComparatorP.
WhentheTnCCLRbitislow,therearetwowaysinwhichthecountercanbecleared.Oneiswhen
acomparematchfromComparatorP,theotheriswhentheCCRPbitsareallzerowhichallows
thecountertooverow.HerebothTnAFandTnPFinterruptrequestagsforComparatorAand
ComparatorPrespectively,willbothbegenerated.
IftheTnCCLRbitintheTMnC1registerishighthenthecounterwillbeclearedwhenacompare
matchoccursfromComparatorA.However,hereonlytheTnAFinterruptrequestflagwillbe
generatedevenifthevalueoftheCCRPbitsislessthanthatoftheCCRAregisters.Thereforewhen
TnCCLRishighnoTnPFinterruptrequestagwillbegenerated.IntheCompareMatchOutput
Mode,theCCRAcannotbesetto“0”.
Asthenameofthemodesuggests,afteracomparisonismade,theTMnoutputpinwillchange
state.TheTMnoutputpinconditionhoweveronlychangesstatewhenaTnAFinterruptrequest
agisgeneratedafteracomparematchoccursfromComparatorA.TheTnPFinterruptrequestag,
generatedfromacomparematchoccursfromComparatorP,willhavenoeffectontheTMnoutput
pin.ThewayinwhichtheTMnoutputpinchangesstatearedeterminedbytheconditionofthe
TnIO1andTnIO0bitsintheTMnC1register.TheTMnoutputpincanbeselectedusingtheTnIO1
andTnIO0bitstogohigh,togolowortotogglefromitspresentconditionwhenacomparematch
occursfromComparatorA.TheinitialconditionoftheTMnoutputpin,whichissetupafterthe
TnONbitchangesfromlowtohigh,issetupusingtheTnOCbit.NotethatiftheTnIO1andTnIO0
bitsarezerothennopinchangewilltakeplace.