[SOLVED] How a high frequency (50 MHz) is measured using a PIC with 4MHz clock?

Status
Not open for further replies.

vinodstanur

Advanced Member level 3
Joined
Oct 31, 2009
Messages
751
Helped
114
Reputation
234
Reaction score
114
Trophy points
1,333
Location
Kerala (INDIA)
Activity points
7,054
How a high frequency ,say 50 MHz is measured using a PIC16 with 4MHz clock? What actually is the method used in this case?
Because I could assume it if it is a low frequency of few KHz..In such case, I hope it could be done by timer increment on external clock....
But the 50 MHz is confusing me...Pls check the link below:
Frequency Meter / Frequency Counter 10Hz-60MHz
 

It uses the timer0 clock input, the timer is set to count with the clock pulses from the external source (the measured signal) with the prescaler enabled so that it can be used with a frequency higher than the internal clock.
It probably uses a second timer as gate for the time that the signal is measured and then it calculates the frequency.

The datasheet says



Alex
 
4MHz is the system clock but the TMR0 counter can actually work much faster and can often accept 50MHz or more.
To measure the frequency you have to reset the timer, wait for a specific time then read the counter value. For example if you reset it, generated a one second delay in software then read the counter back it would tell you the number of cycles per second (Hz). To measure higher frequencies you obviously need shorter times so fewer cycles are captured but the 'gate' or 'window' time can still be generated using a lower clock speed.

Brian.
 
Last edited:
Vinodstanur,

You might find this project discussion informative. It is basically the same design as the link you provided except it utilizes seven segment displays instead of the LCD. It discusses in depth the technique both Alex and Brian pointed out and provides both Assembly Source and Schematics. Of course, the design could easily be adapted to use an LCD instead of the seven segment displays.

Frequency counter with a PIC and minimum hardware

BigDog
 
Thanks for the above link and thats really informative
 
Last edited:

M e I am not gettinn well how counting high frequencies,I designed one it gives good period for lower freqeucnies(f<1Mhz),but above this it is giving wrong period ;can you plz help me with ccs c to count the period for a signal of 1.2Mhz as exaample.

Thanks,I am using pic16f877a and the module CCP1 for detecting those lower frequencies.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…