Frequency counter to be used in communication reciever

I just want to measure frequency of sine square and triangular wave using arduino . And want to display through lcd display 16x2.Circuit to be count
frequency upto 20MHz.
And it can also measure amplitude. Pls help to make code and circuit.

You can not measure a 20MHz signal with a 16 MHz processor.
You can not measure the amplitude of each cycle because the A/D converter takes 100uS to compleat one conversion.

Then how can i measure upto 10MHz frequency without using frequency counter library.

Vishnu15:
Then how can i measure upto 10MHz frequency without using frequency counter library.

The same applies to a 10MHz signal as applies to a 20MHz signal, you can't.

Vishnu15:
Then how can i measure upto 10MHz frequency without using frequency counter library.

Why would you not want to use something that makes things easier for you? :o

(And STOP CROSS-POSTING)

This project is assigned to me. What can I do. Please help me to make a frequency counter using arduino with lcd display.

Is Google not working today? This question has been asked many times before and there are probably many online tutorials showing this. If you have any specific questions about an online example, post the link here and let the experts help with your understanding of the information presented.

To measure up to 20MHz and/or capture the peak voltage, some external circuitry is required.

Wilk you please give idea about the external circuit and code.

Google "prescaler".
I don't know what an "external program" is, or how it would help you

External circuit for peak detection

You need to say what you are doing. The title is the only clue a communication receiver is involved.

Are you trying to display the frequency the communication receiver is tuned to?
Are you trying to display the frequency of an external signal ( if so what has a communication receiver got to do with it )
What degree of accuracy do you want / need?
How many digits does the display need to be?

This project is assigned to me.

So if it is for an academic assignment that grads depend on, should you not be doing this yourself? I have already got my qualifications, the hard way be doing all the work myself without the benefit of the internet.

I just want to measure frequency of external signals (sine,square and triangular) and display the value through lcd. And it want to measure peak amplitude of waves. The counter want to have an option of offset voltage adjusting. Please give idea of external circuitory and code.

Please give idea of external circuitory and code.

You will need a prescaler counting chain to get the input signal frequency down to one that you can measure. You then measure this lower frequency and compensate for the divider chain by multiplying up the reading before displaying it.

Then for the amplitude you will need a peak detector sometimes called an envelope follower to reduce the AC signal to a DC level that you can measure with an Arduino's analogue to digital converter.

Grumpy_Mike.
You are sooo wrong.

Look at this.
They measure 80Mhz with a 20Mhz clocked processor.

This one runs on an even lower clock. 4Mhz.
http://www.electronics-lab.com/50-mhz-frequency-counter/

The net seems to be full of these wonders.

:slight_smile:

Grumpy_Mike.
You are sooo wrong.

That is fighting talk, you are going to have to back that up.

Frequency counter 400Hz to 50MHz with PIC 16F84 under Repository-circuits -51092- : Next.gr

I see what it claims but I can not see any explanation of how it works.

In fact although they don’t mention it, it looks like they are using a prescaler counting chain exactly like I mentioned in reply #12. While they are getting some sort of number they are not getting an accurate measurement because the external clock ( what they are trying to measure ) is not synchronized with the system clock. Section 6.1 of the data sheet says:-

6.2.1 EXTERNAL CLOCK SYNCHRONIZATION
When no prescaler is used, the external clock input is the same as the prescaler output. The synchronization of pin RA4/T0CKI with the internal phase clocks is accomplished by sampling the prescaler output on the Q2 and Q4 cycles of the internal phase clocks (Figure 6-5). Therefore, it is necessary for T0CKI to be high for at least 2Tosc (plus a small RC delay) and low for at least 2Tosc (plus a small RC delay). Refer to the electrical specification of the desired device.
When a prescaler is used, the external clock input is divided by an asynchronous ripple counter type prescaler so that the prescaler output is symmetrical. For the external clock to meet the sampling requirement, the ripple counter must be taken into account. Therefore, it is necessary for T0CKI to have a period of at least 4Tosc (plus a small RC delay) divided by the prescaler value. The only requirement on T0CKI high and low time is that they do not violate the minimum pulse width requirement of 10 ns. Refer to parameters 40, 41 and 42 in the AC Electrical Specifications of the desired device.

They are NOT using a 10MHz processor to measure a 50MHz signal, they are using an internal prescaler to reduce that frequency and that is what they are measuring the reduced frequency. You can do exactly the same thing with an Arduino using an external counter again as I said in reply #12.

So behave yourself and do not be so gullible. >:(

The net seems to be full of these wonders.

And there is one born every minute.

Not fighting talk. Just kidding.
Sorry you took it the wrong way.
I have build many counters, starting in the early seventies.
First one was with nixies.
I think by now I know how counters work.
I was amazed by how many articles I found that seem to be doing this with a low clocked processor.
Just realised they are using a PIC processor. They must have a divider chain inside.
Leo…

All is revealed in Microchip's application note, AN592

JohnLincoln:
All is revealed in Microchip's application note, AN592

Thanks, that is just what I figured out from looking at the data sheet.

Which external counter can I use? What about the code used in arduino...