Rev. 1.50 114 August 28, 2017 Rev. 1.50 115 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
Capture Input Mode
ToselectthismodebitsTnM1andTnM0intheTMnC1registershouldbesetto01respectively.
Thismodeenablesexternalsignalstocaptureandstorethepresentvalueoftheinternalcounter
andcanthereforebeusedforapplicationssuchaspulsewidthmeasurements.Theexternalsignalis
suppliedontheTPnorTCKnpin,selectedbytheTnCAPTSbitintheTMnC1register.Theinput
pinactiveedgecanbeeitherarisingedge,afallingedgeorbothrisingandfallingedges;theactive
edgetransitiontypeisselectedusingtheTnIO1andTnIO0bitsintheTMnC1register.Thecounter
isstartedwhentheTnONbitchangesfromlowtohighwhichisinitiatedusingtheapplication
program.
WhentherequirededgetransitionappearsontheTPnorTCKnpinthepresentvalueinthecounter
willbelatchedintotheCCRAregistersandaTMninterruptgenerated.Irrespectiveofwhatevents
occurontheTPnorTCKnpinthecounterwillcontinuetofreerununtiltheTnONbitchangesfrom
hightolow.WhenaCCRPcomparematchoccursthecounterwillresetbacktozero;inthisway
theCCRPvaluecanbeusedtocontrolthemaximumcountervalue.WhenaCCRPcomparematch
occursfromComparatorP,aTMninterruptwillalsobegenerated.Countingthenumberofoverow
interruptsignalsfromtheCCRPcanbeausefulmethodinmeasuringlongpulsewidths.TheTnIO1
andTnIO0bitscanselecttheactivetriggeredgeontheTPnorTCKnpintobearisingedge,falling
edgeorbothedgetypes.IftheTnIO1andTnIO0bitsarebothsethigh,thennocaptureoperation
willtakeplaceirrespectiveofwhathappensontheTPnorTCKnpin,howeveritmustbenotedthat
thecounterwillcontinuetorun.
AstheTPnorTCKnpinispinsharedwithotherfunctions,caremustbetakeniftheTMnisinthe
InputCaptureMode.Thisisbecauseifthepinissetupasanoutput,thenanytransitionsonthispin
maycauseaninputcaptureoperationtobeexecuted.TheTnCCLR,TnOCandTnPOLbitsarenot
usedinthisMode.