Rev. 2.50 152 June 22, 2017 Rev. 2.50 153 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
Compare Output Mode
Toselectthismode,bitsTnAM1,TnAM0andTnBM1,TnBM0intheTMnC1/TMnC2registers
shouldbeallclearedtozero.Inthismodeoncethecounterisenabledandrunningitcanbecleared
bythreemethods.Theseareacounteroverow,acomparematchfromComparatorAandacompare
matchfromComparatorP.WhentheTnCCLRbitislow,therearetwowaysinwhichthecounter
canbecleared.OneiswhenacomparematchoccursfromComparatorP,theotheriswhenthe
CCRPbitsareallzerowhichallowsthecountertooverow.HereboththeTnAFandTnPFinterrupt
requestagsforComparatorAandComparatorPrespectively,willbothbegenerated.
IftheTnCCLRbitintheTMnC1registerishighthenthecounterwillbeclearedwhenacompare
matchoccursfromComparatorA.However,hereonlytheTnAFinterruptrequestflagwillbe
generatedevenifthevalueoftheCCRPbitsislessthanthatoftheCCRAregisters.Thereforewhen
TnCCLRishighnoTnPFinterruptrequestagwillbegenerated.
Asthenameofthemodesuggests,afteracomparisonismade,theTMoutputpin,willchange
state.TheTMoutputpinconditionhoweveronlychangesstatewhenanTnAForTnBFinterrupt
requestagisgeneratedafteracomparematchoccursfromComparatorAorComparatorB.The
TnPFinterruptrequestflag,generatedfromacomparematchfromComparatorP,willhaveno
effectontheTMoutputpin.ThewayinwhichtheTMoutputpinchangesstateisdeterminedbythe
conditionoftheTnAIO1andTnAIO0bitsintheTMnC1registerforETMCCRA,andtheTnBIO1
andTnBIO0bitsintheTMnC2registerforETMCCRB.TheTMoutputpincanbeselectedusing
theTnAIO1,TnAIO0bits(fortheTPnApin)andTnBIO1,TnBIO0bits(fortheTPnB_0,TPnB_1
orTPnB_2pins)togohigh,togolowortotogglefromitspresentconditionwhenacomparematch
occursfromComparatorAoracomparematchoccursfromComparatorB.Theinitialconditionof
theTMoutputpin,whichissetupaftertheTnONbitchangesfromlowtohigh,issetupusingthe
TnAOCorTnBOCbitforTPnAorTPnB_0,TPnB_1,TPnB_2outputpins.NotethatiftheTnAIO1,
TnAIO0andTnBIO1,TnBIO0bitsarezerothennopinchangewilltakeplace.