Rev. 1.50 92 August 28, 2017 Rev. 1.50 93 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
TMnRP Register
Bit 7 6 5 4 3 2 1 0
Name TnRP7 TnRP6 TnRP5 TnRP4 TnRP3 TnRP2 TnRP1 TnRP0
R/W R/W R/W R/W R/W R/W R/W R/W R/W
POR 0 0 0 0 0 0 0 0
Bit7~0 TnRP7~TnRP0:TMnCCRP8-bitregister,comparedwiththeTMncounterbit15~bit8
ComparatorPmatchperiod:
0:65536TMnclocks
1~255:(1~255)×256TMnclocks
TheseeightbitsareusedtosetupthevalueontheinternalCCRP8-bitregister,which
arethencomparedwiththeinternalcounter’shighesteightbits.Theresultofthis
comparisoncanbeselectedtocleartheinternalcounteriftheTnCCLRbitissetto
zero.SettingtheTnCCLRbittozeroensuresthatacomparematchwiththeCCRP
valueswillresettheinternalcounter.AstheCCRPbitsareonlycomparedwiththe
highesteightcounterbits,thecomparevaluesexistin256clockcyclemultiples.
Clearingalleightbitstozeroisineffectallowingthecountertooverflowatits
maximumvalue.
Standard Type TM Operation Modes
TheStandardTypeTMcanoperateinoneofveoperatingmodes,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,theTMnoutputpin,willchange
state.TheTMnoutputpinconditionhoweveronlychangesstatewhenaTnAFinterruptrequest
agisgeneratedafteracomparematchoccursfromComparatorA.TheTnPFinterruptrequestag,
generatedfromacomparematchoccursfromComparatorP,willhavenoeffectontheTMnoutput
pin.ThewayinwhichtheTMnoutputpinchangesstatearedeterminedbytheconditionofthe
TnIO1andTnIO0bitsintheTMnC1register.TheTMnoutputpincanbeselectedusingtheTnIO1
andTnIO0bitstogohigh,togolowortotogglefromitspresentconditionwhenacomparematch
occursfromComparatorA.TheinitialconditionoftheTMnoutputpin,whichissetupafterthe
TnONbitchangesfromlowtohigh,issetupusingtheTnOCbit.NotethatiftheTnIO1andTnIO0
bitsarezerothennopinchangewilltakeplace.