Rev. 1.50 100 August 28, 2017 Rev. 1.50 101 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.Theexternalsignal
issuppliedontheTPnpin,whoseactiveedgecanbearisingedge,afallingedgeorbothrising
andfallingedges;theactiveedgetransitiontypeisselectedusingtheTnIO1andTnIO0bitsin
theTMnC1register.ThecounterisstartedwhentheTnONbitchangesfromlowtohighwhichis
initiatedusingtheapplicationprogram.
WhentherequirededgetransitionappearsontheTPnpinthepresentvalueinthecounterwillbe
latchedintotheCCRAregistersandaTMninterruptgenerated.Irrespectiveofwhateventsoccuron
theTPnpinthecounterwillcontinuetofreerununtiltheTnONbitchangesfromhightolow.When
aCCRPcomparematchoccursthecounterwillresetbacktozero;inthiswaytheCCRPvalue
canbeusedtocontrolthemaximumcountervalue.WhenaCCRPcomparematchoccursfrom
ComparatorP,aTMninterruptwillalsobegenerated.Countingthenumberofoverowinterrupt
signalsfromtheCCRPcanbeausefulmethodinmeasuringlongpulsewidths.TheTnIO1and
TnIO0bitscanselecttheactivetriggeredgeontheTPnpintobearisingedge,fallingedgeorboth
edgetypes.IftheTnIO1andTnIO0bitsarebothsethigh,thennocaptureoperationwilltakeplace
irrespectiveofwhathappensontheTPnpin,howeveritmustbenotedthatthecounterwillcontinue
torun.TheTnCCLRandTnDPXbitsarenotusedinthisMode.