Author Topic: Frequency counter Project  (Read 41979 times)

0 Members and 1 Guest are viewing this topic.

Offline yalectTopic starter

  • Regular Contributor
  • *
  • Posts: 162
Frequency counter Project
« on: January 13, 2016, 07:20:28 pm »
Hello,
I would like to ask you about simple cheap microcontroller frequency counter circuit, I found some projects but I am looking for one can's measure from Hz up to 200Mhz or more 7-segment LED display maybe with prescaler.
Thank you
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 17143
  • Country: de
Re: Frequency counter Project
« Reply #1 on: January 13, 2016, 08:05:41 pm »
This link mit be interesteing. A few versions to choose from:
http://www.mino-elektronik.de/fmeter/fm_software.htm#bsp1
However text is in german.

For a low cost, version the main idea is to use a µC as a reciprocal counter using the µC internal timing unit. So not much more than input stage, possibly an prescaler and the µC is needed. You might want a better reference oscillator (e.g. TCXO or better).

Its simple but still quite good. STM32F3xx could give 10 ns resolution. The more difficult part is a good input stage.
There are even some plans that use analog interpolation to get better than ns resolution. Though they often use a small CPLD or even FPGA.
 

Offline Liv

  • Regular Contributor
  • *
  • Posts: 139
  • Country: by
Re: Frequency counter Project
« Reply #2 on: January 13, 2016, 08:40:11 pm »
I can offer my design of frequency counter, it is not very simple, but fairly accurate. Uses a reciprocal counting and the interpolator. Compared with the conventional counting, the relative error is not increased at low frequencies. Up to 100 MHz (1 MOhm 30 pF input), with prescaler up to 2 GHz (50 Ohm input).
PSU PSL-3604 Pulse gen. PG-872 Freq. cnt. FC-510
 
The following users thanked this post: 1001

Offline Cloud

  • Regular Contributor
  • *
  • Posts: 194
  • Country: si
Re: Frequency counter Project
« Reply #3 on: January 13, 2016, 08:44:14 pm »
I am currently building a newer version of this http://lea.hamradio.si/~s53mv/counter/history.html
 

Offline cncjerry

  • Supporter
  • ****
  • Posts: 1473
Re: Frequency counter Project
« Reply #4 on: January 13, 2016, 09:02:17 pm »
You might want to consider spending your time making a front end to one of these:

http://www.ebay.com/itm/0-1MHz-2400MHz-Frequency-Counter-Tester-Measurement-For-Ham-Radio-/171964071838?hash=item2809db7f9e:g:io0AAOSw~bFWGIMq

I have one, works well for what it is.  Quality is very good.
 

Online rqsall

  • Regular Contributor
  • *
  • Posts: 87
  • Country: nl
Re: Frequency counter Project
« Reply #5 on: January 14, 2016, 10:55:12 am »
You might want to consider spending your time making a front end to one of these:

http://www.ebay.com/itm/0-1MHz-2400MHz-Frequency-Counter-Tester-Measurement-For-Ham-Radio-/171964071838?hash=item2809db7f9e:g:io0AAOSw~bFWGIMq

I have one, works well for what it is.  Quality is very good.

I've looked at those since you (or someone else) mentioned them in the Microcontrollers & FPGAs forum ("what did you buy that's cheap and cool" or something). But I'm a bit puzzled as to what a front end would entail? Just a BNC with shielded wire to the input of the module, prescalers? Seems like that module is ready to go, but that also sounds a bit too good to be true.

Thanks for any tips.
 

Offline mino-fm

  • Regular Contributor
  • *
  • Posts: 168
  • Country: de
Re: Frequency counter Project
« Reply #6 on: January 14, 2016, 11:30:28 am »
A simple solution with 6 x 7-segment digits could be this. http://mino-elektronik.de/7-Segment-Variationen/LCD.htm#led2
Using an Atmega328 and prescaler 74VHC4040 input frequency range is 0.016 Hz – 200 MHz with autoranging and RS232 serial data output.

Another reciprocal frequency counter based on STM32F429 Discovery board uses its TFT-display for showing frequency and period at the same time. http://mino-elektronik.de/FM_407/fmeter_407.htm#c1
Autoranging with 7 digits resolution the allowable input frequency is 0.05 Hz – 90 MHz using an internal timer as prescaler. Adding an external %2048 prescaler the upper frequency limit is arround 4 GHz. With a cheap prescaler like 74VHC4040 upper frequency limit is >= 200 MHz @ 5 Vcc.

Let me know, if your translation programm is telling you stupid things. I'll try to respond to your problems on request.
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1485
  • Country: 00
Re: Frequency counter Project
« Reply #7 on: January 14, 2016, 11:38:24 am »
The main issue with simple counters is that they are slow with 7-8 digits / second measurement speed. That is sufficient for doing most stuff, but not enough for demanding measurements.

Higher performance counters use a number of techniques to be faster.
- Creating a much higher frequency reference from the main reference, 1974 500 MHz were state of the art.
- Using multiple reference phase clocks (e.g. a four phase clock quadruples time resolution)
- Using analog interpolation

With all of these high performance counters reach 12 digits / second measurement speed.
,
 

Offline Liv

  • Regular Contributor
  • *
  • Posts: 139
  • Country: by
Re: Frequency counter Project
« Reply #8 on: January 14, 2016, 12:20:13 pm »
With all of these high performance counters reach 12 digits / second measurement speed.

I tried to multiply the reference frequency. But refused to simplify the design. Rreciprocal counting and analog interpolator give my frequency counter 9 digits per second, which is enough for an amateur device.
PSU PSL-3604 Pulse gen. PG-872 Freq. cnt. FC-510
 

Offline yalectTopic starter

  • Regular Contributor
  • *
  • Posts: 162
Re: Frequency counter Project
« Reply #9 on: January 16, 2016, 04:58:41 pm »
Hello,
But can I make the counter with cheap microcontroller like 16F84 and 7-segment LED display for measuring from frequencies from Hz up to 200Mhz or more?.
I found some projects but they don't measure in Hz or low frequencies
Thank you
 

Offline ThomasDK

  • Regular Contributor
  • *
  • Posts: 139
  • Country: dk
  • B.Eng. EE
Re: Frequency counter Project
« Reply #10 on: January 16, 2016, 06:07:45 pm »
16F84 is ancient. I see several links in this thread with 7 seg displays and a small mcu... What's the problem?
 

Offline yalectTopic starter

  • Regular Contributor
  • *
  • Posts: 162
Re: Frequency counter Project
« Reply #11 on: January 16, 2016, 08:26:39 pm »
Thank you for your reply
the Problem is How we can make cheap microcontroller like 16F84 or small working up to high frequencies such 200Mhz or 1Ghz
- Have you simple example for 16F84 7seg LED display?
Thank you
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 22329
  • Country: gb
  • 0999
Re: Frequency counter Project
« Reply #12 on: January 16, 2016, 09:33:04 pm »
You need a prescaler. The MC12093 is the cheapest I could find which meets your spec.
http://www.mouser.com/ds/2/308/MC12093-D-95212.pdf
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 17143
  • Country: de
Re: Frequency counter Project
« Reply #13 on: January 16, 2016, 09:57:00 pm »
For the high frequencies one essentially needs a prescaler to reduce the higher frequencies to a frequency range the µC can handle.  There are rather small and cheap prescalers (dividers) that can reduce the frequency by a factor of 256 or similar. A relativly cheap version is a U813 - working up to about 1 GHz.  The small µCs can handle slightly depends on the µC used, and the method used.

Direct counting allows high frequenies, but resolution is limited, especially at low frequencies. PIC counter projects somewhat prefer direct couning as they have an internal prescaler for this mode that allows them to work up to about 40 MHz without extra Hardware.

In reciprocal counting mode the frequency limit is lower (e.g. 100 kHz), but resolution is good at low frequency too and is not reduced by the prescaler - so a higher prescaler can be used. Usually two ranges (with and without prescaler) would be needed for something like a 200 MHz - 1 Hz range. Obove there are links for such counters with AVR and ARM µCs - if you like PICs, somthing like a suitable PIC18 should do it as well, if it has a suitable timer that can do time stamping at high resolution.
 

Offline Gandalf_Sr

  • Super Contributor
  • ***
  • Posts: 1729
  • Country: us
Re: Frequency counter Project
« Reply #14 on: January 18, 2016, 11:04:00 am »
I am currently building a newer version of this http://lea.hamradio.si/~s53mv/counter/history.html
I started this a while back too and I have a lot of time into it with nice OLED display and higher end PIC.  I'm willing to share the design here if you guys want to collaborate?  First Step would be an engineering design review of my schematic.

I'm really a hardware designer, I could write the software but would be happy to pass that aspect over to someone else due to time constraints.
If at first you don't succeed, get a bigger hammer
 

Offline mino-fm

  • Regular Contributor
  • *
  • Posts: 168
  • Country: de
Re: Frequency counter Project
« Reply #15 on: March 28, 2016, 09:02:40 am »
For panelmeters and/or battery-powered devices here is another simple 5-digit counter based on ATmega48. http://mino-elektronik.de/fmeter/fm_software.htm#bsp13
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Frequency counter Project
« Reply #16 on: March 28, 2016, 10:22:03 am »
The basic concept is simple: count pulses within a time base.

The actual implementation is more complex, however, depending on your needs.

The simplest I have built has just the mcu: readout done via a user connection.

More complex ones have a four digit led, a crystal, and a input protection resistor.

Pics have an advantage here due to its asynchronous counter.
================================
https://dannyelectronics.wordpress.com/
 

Offline Liv

  • Regular Contributor
  • *
  • Posts: 139
  • Country: by
Re: Frequency counter Project
« Reply #17 on: March 28, 2016, 01:49:48 pm »
The basic concept is simple: count pulses within a time base.

This is true only for primitive frequency counters.
PSU PSL-3604 Pulse gen. PG-872 Freq. cnt. FC-510
 

Offline Cloud

  • Regular Contributor
  • *
  • Posts: 194
  • Country: si
Re: Frequency counter Project
« Reply #18 on: March 28, 2016, 04:11:15 pm »
I am currently building a newer version of this http://lea.hamradio.si/~s53mv/counter/history.html
I started this a while back too and I have a lot of time into it with nice OLED display and higher end PIC.  I'm willing to share the design here if you guys want to collaborate?  First Step would be an engineering design review of my schematic.

I'm really a hardware designer, I could write the software but would be happy to pass that aspect over to someone else due to time constraints.
There is a new version which uses PIC 18F258 and has a computer program to collect data on computer.
Here is a link to the article about it (Unfortunately it is in Slovenian language) https://www.dropbox.com/s/91tu4q9xdk6ict6/frekvencm.pdf?dl=0
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Frequency counter Project
« Reply #19 on: March 28, 2016, 05:54:26 pm »
"This is true only for primitive frequency counters."

And also the most advanced counters of today that continuously count the incoming pulse train.

But end of the day, it is the same principle: the reciprocal counters use the incoming pulse train as a time base and count a known clock.

Interpolators add additional precision but the basic principle is the same.
================================
https://dannyelectronics.wordpress.com/
 

Offline Liv

  • Regular Contributor
  • *
  • Posts: 139
  • Country: by
Re: Frequency counter Project
« Reply #20 on: March 29, 2016, 12:49:48 pm »
the reciprocal counters use the incoming pulse train as a time base and count a known clock.

No. Time base T is formed by the reference generator. During this time, it counts the number of whole periods N of the input frequency and the corresponding number of periods M of the reference frequency. The input frequency is calculated as Fin = Fref * N / M. This structure requires a computing device in frequency counter and different logic for counting gates.
PSU PSL-3604 Pulse gen. PG-872 Freq. cnt. FC-510
 

Online voltsandjolts

  • Supporter
  • ****
  • Posts: 3668
  • Country: gb
Re: Frequency counter Project
« Reply #21 on: March 30, 2016, 07:32:04 pm »

This one is quite very impressive:

http://andybrown.me.uk/2016/02/21/nanocounter/

After reading that I feel dumb.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Frequency counter Project
« Reply #22 on: March 30, 2016, 08:18:41 pm »
Quote
The input frequency is calculated as Fin = Fref * N / M.

So think of your counting the reference clock over a period of time gated by the input signal. The time elapsed on the gate is Fin / N for the incoming signal. The time elapsed according to the reference signal is Fref / M. And the two must be the same. The reason you swap the two pulse trains is so you have a more resolution with the faster Fref.

But the basic principle is the same: using two signals to gate each other. In the direct counting mode, you use a known signal to gate the incoming pulse train. In the reciprocal counting mode, you use the incoming pulse train to gate the reference signal.

The time base can be formed by counting a number of a known reference signal (in the direct counting mode), or by counting an unknown incoming signal.
================================
https://dannyelectronics.wordpress.com/
 

Offline Liv

  • Regular Contributor
  • *
  • Posts: 139
  • Country: by
Re: Frequency counter Project
« Reply #23 on: March 30, 2016, 10:41:27 pm »
This one is quite very impressive:

An interesting project. While I believe the multiplication of the reference frequency is not a good idea due to the phase noise. At least, crystal oscillators SG8002 from Epson that are PLL behave badly in frequency counter. Good frequency counters filter desired harmonic of VCXO, instead of multiplying the reference clock by a PLL. Even if we do not take this into account, the reference frequency of 200 MHz gives a time resolution of 5 ns, but my FC-510 due to the interpolator has a resolution of about 1 ns.

The reason you swap the two pulse trains is so you have a more resolution with the faster Fref.

Input frequency can be changed or disappear completely. This causes some difficulties. For example, it is difficult to use the interpolator with variable clock. Better then to increase the reference frequency to a maximum value at which the counters are working. When the reference frequency is constant, the reciprocal frequency counter has a constant relative error of measurement, which is independent of the input frequency. Usually it is enough. Increasing the resolution does not make sense because of the reference oscillator instability.
« Last Edit: March 30, 2016, 10:56:15 pm by Liv »
PSU PSL-3604 Pulse gen. PG-872 Freq. cnt. FC-510
 

Offline mino-fm

  • Regular Contributor
  • *
  • Posts: 168
  • Country: de
Re: Frequency counter Project
« Reply #24 on: March 31, 2016, 09:33:47 am »

This one is quite very impressive:

http://andybrown.me.uk/2016/02/21/nanocounter/

After reading that I feel dumb.

Don’t be sad! Today, it’s no problem to realize a frequency counter with internal 200 MHz reference. You don’t need any FPGA design, just a simple STM32F407 (168 MHz normal, 200 MHz overclocked) or a newer one like STM32F745 (216 MHz internal clock) will be sufficient.
Above, I’ve shown an example for STM32F429-Discovery-Board. A simple 2-sided board design you can find here: http://mino-elektronik.de/FM_407/fmeter_407.htm

1 – 4 channels, 8 digits each, 2 reading/s all channels at the same time, Xtal, TCXO or external clock with optional GPS stabilization (1pps-signal) at channel 4.
Look at the pictures so you don’t have to translate the german text ;-)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf