Hi,
I am building a frequency counter that can measure up to 50Mhz using PIC16F872, which has an operating frequency DC of 20Mhz. Would like to know if there are any circuits that I can make reference to? And can this be done using this PIC by using a prescaler of 256 ? thanks
A 20MHz, or 5MIPs PIC can detect bit changes of at most 2.5MHz, That gives the ability to detect frquencies of aronud 1MHz, maybe lesser. What is usually done is that we divide the frrequency. There are various ways to do this, including demultiplexers, shmitt triggers, counters and so on.
hi, is it possible to implement the divider method using software ? or must i really have a hardware cct for the divider using counter etc ? Cuz for the PIC chip, there is inbuilt prescaler to up to 256 for timer0. thanks
hi, is it possible to implement the divider method using software ? or must i really have a hardware cct for the divider using counter etc ? Cuz for the PIC chip, there is inbuilt prescaler to up to 256 for timer0. thanks
As I mentioned, a 5MIPs PIC by itself can at most detect up to a 1MHz signal. In other words, it's too slow. Even 1MHz is a very optimistic estimate.
That's the reason why we use hardware circuits to implement the frequency divider. You must realise that microprocessors in general are considered very slow creatures in relative terms.
Actually, the micro is not used to sample the actual input signal. Rather, the counter (a hardware device) counts the pulses. The counter and the prescaler can count pulses with a frequency of up to 50MHz. The micro "per se" only does the gating. Then it reads 16 bits out of the counter and prescaler (using a little SW trick), but his operation is now done "off-line". It can take any amount of time.
Please read the Microchip's appnote AN592.
I once made a device using 16F872 that was actually an RF power meter,but also could measure frequency.It used 2-line LCD for display.
I was really surprised that it could measure frequencies as high as 80 MHz!
If you want,I can send you the circuit and the source of the program.
You can get rid of the power-metering stuff and leave only what you need.
Send me a PM if you need more help.
I once made a device using 16F872 that was actually an RF power meter,but also could measure frequency.It used 2-line LCD for display.
I was really surprised that it could measure frequencies as high as 80 MHz!
If you want,I can send you the circuit and the source of the program.
You can get rid of the power-metering stuff and leave only what you need.
Send me a PM if you need more help.
Hi,
since there were some people interested in my project,
and since I misplaced its circuit,I opened the bloody thing and tried to draw a presentable circuit.
I double-checked it,so I hope it's correct.
In the file I send there is also an info about how to make it work only as a counter.
The file mw.hex works fine.The file counter.hex I haven't tested,but I think it should work,too.
If you have some more questions,send me a PM.