ThePIC16C5Xhasone8-bittimer(Timer0),whichcan

beusedwithan8-bitprescaler.Theprescalerruns

asynchronously,henceitcancountaveryhigh

frequency.Theminimumriseandfalltimesoftheinput

frequencyarespecifiedtobe10ns,sothefastestclock

ratetheTMR0cancountis50MHz.Theprescalermust

beusedwhenmeasuringhighfrequency.Sincethe

prescalercanbeconfiguredasadivideby256counter,

themaximumresolutionatwhichtheinputfrequency

canbemeasuredis16-bits.However,theprescaler

cannotbedirectlyreadlikeafileregister.Thisapplica-

tionnotedepictsauniquemethodbywhichtheuser

can“extract”the8-bitvalueintheprescaler,whereby

theresolutionofthemeasurementis16-bitswiththe

high8-bitsinTMR0andthelow8-bitsintheprescaler.AN592FrequencyCounterUsingPIC16C5XTMR0isconguredtomeasuretheinputfrequency,atAuthor:StanD’SouzaT0CKIofthePIC16C54.Theinputfrequencyis“gated”MicrochipTechnologyInc.foraprecisedurationoftime.Beforestartingthispre-cise“gate”,TMR0iscleared(whichalsoclearstheINTRODUCTIONprescaler),andtheRA2pinisconguredasaninput.Theprecise“gate”is

使用PIC16C5X的频率计数器

使用PIC16C5X的频率计数器