Rev. 2.50 166 June 22, 2017 Rev. 2.50 167 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
Capture Input Mode
ToselectthismodebitsTnAM1,TnAM0andTnBM1,TnBM0intheTMnC1andTMnC2registers
shouldbesetto01respectively.Thismodeenablesexternalsignalstocaptureandstorethe
presentvalueoftheinternalcounterandcanthereforebeusedforapplicationssuchaspulsewidth
measurements.TheexternalsignalissuppliedontheTPnAandTPnB_0,TPnB_1,TPnB_2pins,
whoseactiveedgecanbeeitherarisingedge,afallingedgeorbothrisingandfallingedges;the
activeedgetransitiontypeisselectedusingtheTnAIO1,TnAIO0andTnBIO1,TnBIO0bitsinthe
TMnC1andTMnC2registers.ThecounterisstartedwhentheTnONbitchangesfromlowtohigh
whichisinitiatedusingtheapplicationprogram.
WhentherequirededgetransitionappearsontheTPnAandTPnB_0,TPnB_1,TPnB_2pinsthe
presentvalueinthecounterwillbelatchedintotheCCRAandCCRBregistersandaTMinterrupt
generated.IrrespectiveofwhateventsoccurontheTPnAandTPnB_0,TPnB_1,TPnB_2pins
thecounterwillcontinuetofreerununtiltheTnONbitchangesfromhightolow.WhenaCCRP
comparematchoccursthecounterwillresetbacktozero;inthiswaytheCCRPvaluecanbeused
tocontrolthemaximumcountervalue.WhenaCCRPcomparematchoccursfromComparatorP,
aTMinterruptwillalsobegenerated.Countingthenumberofoverowinterruptsignalsfromthe
CCRPcanbeausefulmethodinmeasuringlongpulsewidths.TheTnAIO1,TnAIO0andTnBIO1,
TnBIO0bitscanselecttheactivetriggeredgeontheTPnAandTPnB_0,TPnB_1,TPnB_2pins
tobearisingedge,fallingedgeorbothedgetypes.IftheTnAIO1,TnAIO0andTnBIO1,TnBIO0
bitsarebothsethigh,thennocaptureoperationwilltakeplaceirrespectiveofwhathappensonthe
TPnAandTPnB_0,TPnB_1,TPnB_2pins,howeveritmustbenotedthatthecounterwillcontinue
torun.
AstheTPnAandTPnB_0,TPnB_1,TPnB_2pinsarepinsharedwithotherfunctions,caremust
betakeniftheTMisintheCaptureInputMode.Thisisbecauseifthepinissetupasanoutput,
thenanytransitionsonthispinmaycauseaninputcaptureoperationtobeexecuted.TheTnCCLR,
TnAOC,TnBOC,TnAPOLandTnBPOLbitsarenotusedinthismode.