User`s guide
Rev. 1.10 82 November 14, 2014 Rev. 1.10 83 November 14, 2014
HT66FW2230
Wireless Charger A/D Flash 8-Bit MCU
Capture Input Mode
ToselectthismodebitsT0M1andT0M0intheTM0C1registershouldbesetto01respectively.
Thismodeenablesexternalsignalstocaptureandstorethepresentvalueoftheinternalcounter
andcanthereforebeusedforapplicationssuchaspulsewidthmeasurements.Theexternalsignal
issuppliedontheTP0pin,whoseactiveedgecanbeeitherarisingedge,afallingedgeorboth
risingandfallingedges;theactiveedgetransitiontypeisselectedusingtheT0IO1andT0IO0bits
intheTM0C1register.ThecounterisstartedwhentheT0ONbitchangesfromlowtohighwhichis
initiatedusingtheapplicationprogram.
WhentherequirededgetransitionappearsontheTP0pinthepresentvalueinthecounterwillbe
latchedintotheCCRAregistersandaTMinterruptgenerated.Irrespectiveofwhateventsoccuron
theTP0pinthecounterwillcontinuetofreerununtiltheT0ONbitchangesfromhightolow.When
aCCRPcomparematchoccursthecounterwillresetbacktozero;inthiswaytheCCRPvaluecanbe
usedtocontrolthemaximumcountervalue.WhenaCCRPcomparematchoccursfromComparator
P,aTMinterruptwillalsobegenerated.Countingthenumberofoverowinterruptsignalsfrom
theCCRPcanbeausefulmethodinmeasuringlongpulsewidths.TheT0IO1andT0IO0bitscan
selecttheactivetriggeredgeontheTP0pintobearisingedge,fallingedgeorbothedgetypes.If
theTnIO1andT0IO0bitsarebothsethigh,thennocaptureoperationwilltakeplaceirrespectiveof
whathappensontheTP0pin,howeveritmustbenotedthatthecounterwillcontinuetorun.
AstheTP0pinispinsharedwithotherfunctions,caremustbetakeniftheTMisintheInputCapture
Mode.Thisisbecauseifthepinissetupasanoutput,thenanytransitionsonthispinmaycausean
inputcaptureoperationtobeexecuted.TheT0CCLRandT0DPXbitsarenotusedinthisMode.
Counter Value
YY
CCRP
TnON
TnPAU
CCRP Int.
Flag TnPF
CCRA Int.
Flag TnAF
CCRA
Value
Time
Counter cleared
by CCRP
Pause
Resume
Counter
Reset
TnM [1:0] = 01
TM capture
pin TPn_x
XX
Counter
Stop
TnIO [1:0]
Value
XX
YY XX
YY
Active
edge
Active
edge
Active edge
00 – Rising edge
01 – Falling edge
10 – Both edges 11 – Disable Capture
Capture Input Mode
Note:1.TnM[1:0]=01andactiveedgesetbytheTnIO[1:0]bits
2.ATMCaptureinputpinactiveedgetransfersthecountervaluetoCCRA
3.TheTnCCLRbitisnotused
4.Nooutputfunction-TnOCandTnPOLbitsarenotused
5.CCRPdeterminesthecountervalueandthecounterhasamaximumcountvaluewhen
CCRPisequaltozero.
6.n=0