Frequency counter Project - Page 1
Forum section: electronics / projects

author: yalect
author_rank: Regular Contributor
timestamp: January 13, 2016, 07:20:28 pm
content: 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

author: Kleinstein
author_rank: Super Contributor
timestamp: January 13, 2016, 08:05:41 pm
content: This link mit be interesteing. A few versions to choose from:http://www.mino-elektronik.de/fmeter/fm_software.htm#bsp1However 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.

author: Liv
author_rank: Regular Contributor
timestamp: January 13, 2016, 08:40:11 pm
content: I can offer mydesignof 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).

author: Cloud
author_rank: Regular Contributor
timestamp: January 13, 2016, 08:44:14 pm
content: I am currently building a newer version of thishttp://lea.hamradio.si/~s53mv/counter/history.html

author: cncjerry
author_rank: Unknown
timestamp: January 13, 2016, 09:02:17 pm
content: 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~bFWGIMqI have one, works well for what it is. Quality is very good.

author: rqsall
author_rank: Regular Contributor
timestamp: January 14, 2016, 10:55:12 am
content: Quote from: cncjerry on January 13, 2016, 09:02:17 pmI'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.

author: mino-fm
author_rank: Regular Contributor
timestamp: January 14, 2016, 11:30:28 am
content: A simple solution with 6 x 7-segment digits could be this.http://mino-elektronik.de/7-Segment-Variationen/LCD.htm#led2Using 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#c1Autoranging 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.

author: dom0
author_rank: Super Contributor
timestamp: January 14, 2016, 11:38:24 am
content: 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 interpolationWith all of these high performance counters reach 12 digits / second measurement speed.

author: Liv
author_rank: Regular Contributor
timestamp: January 14, 2016, 12:20:13 pm
content: Quote from: dom0 on January 14, 2016, 11:38:24 amI 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.

author: yalect
author_rank: Regular Contributor
timestamp: January 16, 2016, 04:58:41 pm
content: Hello,But can I make the counter with cheap microcontroller like16F84and7-segment LED displayfor measuring from frequencies from Hz up to 200Mhz or more?.I found some projects but they don't measure in Hz or low frequenciesThank you

author: ThomasDK
author_rank: Regular Contributor
timestamp: January 16, 2016, 06:07:45 pm
content: 16F84 is ancient. I see several links in this thread with 7 seg displays and a small mcu... What's the problem?

author: yalect
author_rank: Regular Contributor
timestamp: January 16, 2016, 08:26:39 pm
content: Thank you for your replythe 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

author: Zero999
author_rank: Super Contributor
timestamp: January 16, 2016, 09:33:04 pm
content: 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

author: Kleinstein
author_rank: Super Contributor
timestamp: January 16, 2016, 09:57:00 pm
content: 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.

author: Gandalf_Sr
author_rank: Super Contributor
timestamp: January 18, 2016, 11:04:00 am
content: Quote from: Cloud on January 13, 2016, 08:44:14 pmI 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.

author: mino-fm
author_rank: Regular Contributor
timestamp: March 28, 2016, 09:02:40 am
content: 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

author: dannyf
author_rank: Super Contributor
timestamp: March 28, 2016, 10:22:03 am
content: 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.

author: Liv
author_rank: Regular Contributor
timestamp: March 28, 2016, 01:49:48 pm
content: Quote from: dannyf on March 28, 2016, 10:22:03 amThis is true only for primitive frequency counters.

author: Cloud
author_rank: Regular Contributor
timestamp: March 28, 2016, 04:11:15 pm
content: Quote from: Gandalf_Sr on January 18, 2016, 11:04:00 amThere 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

author: dannyf
author_rank: Super Contributor
timestamp: March 28, 2016, 05:54:26 pm
content: "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.

author: Liv
author_rank: Regular Contributor
timestamp: March 29, 2016, 12:49:48 pm
content: Quote from: dannyf on March 28, 2016, 05:54:26 pmNo. 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.

author: voltsandjolts
author_rank: Unknown
timestamp: March 30, 2016, 07:32:04 pm
content: This one isquitevery impressive:http://andybrown.me.uk/2016/02/21/nanocounter/After reading that I feel dumb.

author: dannyf
author_rank: Super Contributor
timestamp: March 30, 2016, 08:18:41 pm
content: QuoteSo 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.

author: Liv
author_rank: Regular Contributor
timestamp: March 30, 2016, 10:41:27 pm
content: Quote from: voltsandjolts on March 30, 2016, 07:32:04 pmAn 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.Quote from: dannyf on March 30, 2016, 08:18:41 pmInput 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.

author: mino-fm
author_rank: Regular Contributor
timestamp: March 31, 2016, 09:33:47 am
content: Quote from: voltsandjolts on March 30, 2016, 07:32:04 pmDon’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.htm1 – 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 ;-)

author: Liv
author_rank: Regular Contributor
timestamp: March 31, 2016, 12:08:30 pm
content: Quote from: mino-fm on March 31, 2016, 09:33:47 amYou can only make a primitive direct counting frequency counter. STM32 timers do not allow to implement the reciprocal frequency counter (at least, without external logic or other tricks). About interpolator can not even speak.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 31, 2016, 03:31:22 pm
content: Modern µCs can very well use the timers to make a reciprocal counter. However that might be a limitation for the maximum input frequency, that may not be high enough for a universal counter. So an external prescaler may very well be needed.Some chips (AFAIK some PIC) may even include a circuitry usable for an analog interpolator.

author: Liv
author_rank: Regular Contributor
timestamp: March 31, 2016, 05:26:12 pm
content: Quote from: Kleinstein on March 31, 2016, 03:31:22 pmSo it might seem at first glance. But if you try to do this, things are not so good. Modern µCs timers are not adapted to the implementation of the reciprocal counter.Quote from: Kleinstein on March 31, 2016, 03:31:22 pmYes, some PICs have Charge Time Measurement Unit (CTMU). But I doubt very much that it can help in the implementation of the interpolator. Frequency counter - a digital device that has two clock domains: input frequency domain and reference frequency domain. All external signals in µCs pass through synchronizers and associated with internal clock domain. Therefore, a good frequency counter uses CPLD or FPGA.

author: dannyf
author_rank: Super Contributor
timestamp: March 31, 2016, 05:30:54 pm
content: "All external signals in µCs pass through synchronizers and associated with internal clock domain."Some pics have asynchronous counters. Some avrs too actually.

author: xyrtek
author_rank: Regular Contributor
timestamp: March 31, 2016, 06:06:04 pm
content: In case this can be useful for someone else that arrives at this thread, may I suggest:http://www.foxdelta.com/products/fc3.htmIn fact look around, there are several versions of not only FC but some other useful kits.They sell the PCBs for most recent projects at very, very low cost. The owner replies to emails and is a great person!!!EDIT:answer framed for original question.Quote

author: Kleinstein
author_rank: Super Contributor
timestamp: March 31, 2016, 06:49:39 pm
content: The PIC based counter fromhttp://www.foxdelta.com/products/fc3.htmseems to be based on direct counting. So not a reciprocal counter.For building a reciprocal counter most (if not all) of the circuit is in the clock domain of the reference clock. The only part that needs a different clock domain (or just use a ripple counter) is a possible prescaling divider. Some extra start stop modes might also want extra logic - but this is usually not a must have for a frequency counter. So with the µC running from the reference clock it is no problem using the µC internal timers for an reciprocal counter.

author: Liv
author_rank: Regular Contributor
timestamp: March 31, 2016, 07:13:24 pm
content: Quote from: Kleinstein on March 31, 2016, 06:49:39 pmIt is not true. Give then at least a brief description of the structure of the reciprocal frequency counter. Of course, I do not mean the option, when in the process of measuring the software processing is involved. The frequency counter should run up to 1/2 of the CPU clock.With the software processing is simple. For example, the input signal is fed to the capture input of timer, which counts the number of reference clock periods, and the number of periods of the input frequency is counting in the capture interrupt. But then the maximum input frequency is 20 - 50 times lower than the clock frequency. On the AVR this way I was getting the measurement frequency up to 500 kHz. It seemed that the more complex STM32 timers allow to abandon software processing, but it is not. On one of the forums was a variant of the reciprocal frequency counter based on the STM32, but it can not be called elegant.

author: mino-fm
author_rank: Regular Contributor
timestamp: May 13, 2016, 04:01:31 pm
content: QuoteReading this I'm a little bit astonished. In between maybe you found out, that this is not true.With STM32 devices running at 200 MHz you can built 'true' reciprocal counters with 5 ns resolution, which will give you 8 digits resolution @ 2 measurements/s.Thinking about a separate external interpolator to get 1 ns resolution seems not very attractive to me, because the improvement will only be factor 5. Factor 50 or 100 would be much better, but I don't know if you can handle 0.1 ns delays with discrete components. At last you need a very stable reference signal AND a stable input signal as well.For common applications (RC- or XTAL oscillators) a counter with 5-7 digits will be sufficient.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 13, 2016, 05:01:34 pm
content: The interpolator is not only useful for stable signals where high resolution is wanted. It's more needed for measuring short times (e.g µs rang) . However this usually will need two interpolating units: one for start and one for stop.If it is just for high resolution on stable signals, one could use timestamping, to measure the time for more than just the first and last transition. This allows higher resolution and suppression of trigger noise - however sensitivity to true signal frequency noise can be larger. The hardware is the same as for normal reciprocal counting, just get the time for more transitions.

author: Liv
author_rank: Regular Contributor
timestamp: May 13, 2016, 05:41:01 pm
content: Quote from: mino-fm on May 13, 2016, 04:01:31 pmWhat does the delay? Interpolator based on capacitor charge during the measured time with a further voltage measurement using the built-in STM32 ADC will provide sub-ns resolution.Quote from: mino-fm on May 13, 2016, 04:01:31 pmNever seen implementation. You will need one timer clock the reference frequency, the second - the input frequency. In this case both timers need to enable / disable strictly at the same time, ie, in a single machine cycle. In addition, in synchronism with the transition of the input signal. STM32 timers logic does not allow it.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 13, 2016, 06:23:16 pm
content: Counting the input signal can be done in software. Or maybe with one of the internal counter triggering on a capture event (not sure the STM32 can do that). This will limit the input frequency a little, to something like 1 or 5 MHz - but a similar (if not lower) limit would apply to an analog interpolator as well. A prescaler can easy take care of this. So two ranges are needed: one for the high frequencies that could work down to something like 10 kHz and one for the lower frequencies that can work up to about 5 MHz depending on the implementation.

author: Liv
author_rank: Regular Contributor
timestamp: May 13, 2016, 07:18:35 pm
content: Yes, software counting is possible. But when they say that in the STM32 realized "true reciprocal frequency counter", you want to expect the maximum frequency of up to 1/2Fclk.

author: mino-fm
author_rank: Regular Contributor
timestamp: May 14, 2016, 08:46:12 am
content: Quote from: Liv on May 13, 2016, 05:41:01 pmHere you can find a picture of a STM32F429-discovery based counter, reduced to 7 digits because of simple 8 MHz XTAL clock reference:https://www.mikrocontroller.net/topic/384435#4388056Reference clock is corrected (with green trimmer) by 77.90 ppm to show exact results. STM32F429 is running at 180 MHz so input frequency range is from 0.05 Hz to about 90 MHz @ 3 readings/s.Input signal is supplied by orange cable and the internal prescaler (input = PB4) is connected by grey cable from PC8 (presc. output) to PE6.The little red LED shows prescaler is activated.Here you can see another reciprocal counter based on STM32F407-discovery with 4,3" TFT (direct-drive):https://www.mikrocontroller.net/topic/275225#2891811Reciprocal counters based on STM32 work fine and you can realise several channels with only one µC. Believe it or not - I don't mind :-)

author: dannyf
author_rank: Super Contributor
timestamp: May 14, 2016, 10:41:42 am
content: QuoteNothing magical about reciprocal counting vs. direct counting - both need two "clocks" (one input / signal + one reference). The only difference between the two is who's used to count whom.As to STM32, the use of pll clock there can be problematic from a phase noise perspective -> less of an issue if you continue the counting.

author: danadak
author_rank: Super Contributor
timestamp: May 14, 2016, 11:30:12 am
content: Some useful reference material.https://www.dropbox.com/s/dmnyb69ntfgd3o3/Counters.zip?dl=0Regards, Dana.

author: Liv
author_rank: Regular Contributor
timestamp: May 14, 2016, 01:57:00 pm
content: Quote from: mino-fm on May 14, 2016, 08:46:12 amIn the picture we can not say how well implemented frequency counter. Please specify how peripheral initialization and measurement procedure. One way to implement the reciprocal counter I found on the net, but it looked not very elegant:1. TIM2 init to PWM mode/One-pulse mode, external clock - Gate and count N_input2. Load to TIM2->ARR max. value3. Init TIM3 and TIM15 (chain connected) as Slave timer in Gated mode (triggered by TIM2) - count N_ref4. Start TIM25. Delay 0.5 s (for 1 s gate time)6. Read TIM2->CNT, mul by 2, load to TIM2->ARR (on the fly)7. Wait for TIM2 stops count8. F_in = F_clk * TIM2->CNT (N_input) / TIM3, TIM15->CNT (N_ref)

author: mino-fm
author_rank: Regular Contributor
timestamp: May 15, 2016, 10:18:33 am
content: Quote from: Liv on May 14, 2016, 01:57:00 pmFollowing the 2. link, you will see the source-code of 'f_mess.c'. This is the very first implementation of reciprocal counter on STM32F407 and shows the basic operation only.https://www.mikrocontroller.net/attachment/158664/f_mess.c16 bit counter TIM9 is used as reference counter running at 168 MHz. Once initialised TIM9 is never stopped again!Each event on PE5 (TIM9-capture input) increments a 32 bit software-counter and gives an exact time-stamp with 5,95 ns (1/168 MHz) resolution. Overuns of TIM9 are counted as well and are always taken into account, resulting in 32 bit time-stamps synchronously to the input event.LOOP:Starting measurement synchronously with the first input event, after some time (arround 0.5 s for 8 digits) you can take the last time-stamp (end_zeit -> end_time), substract the first time-stamp (start_zeit -> start_time) and you’ll get the actual time (mess_zeit -> act_time):act_time = end_time – start_time;Doing the same thing with counted input pulses you will get the number of events (mess_ereignisse -> act_count) as the difference of last count (end_ereignis -> end_count) and first count (start_ereignis -> start_count):act_count = end_count – start_count;To prepare next calculation simply update start_time and start_count:start_time = end_time;start_count = end_count;Finally we want to see the result of frequency:frequency = act_count * 168e6 / act_time;Convert and display frequency andgoto LOOP:Looking at the photo of TFT-display act_count is displayed as 'Nin' and act_time as 'Nref'.During measurement there is no stop (no missing input event). That is why you will get one reading/s @ 1 Hz input signal. For faster results with less digits needed, you can reduce measurement time to 1 ms and will get 1000 readings/s @ 5 digits resolution.

author: Liv
author_rank: Regular Contributor
timestamp: May 15, 2016, 10:49:38 am
content: Quote from: mino-fm on May 15, 2016, 10:18:33 amThis is not true hardware reciprocal frequency counter. Input pulse count is software, so their frequency must be much lower Fclk/2, as should have time to execute the interrupt handler. I mean a true hardware timers-based frequency counter that do not require real-time software processing. In the post above, I gave an example of such a solution.

author: mino-fm
author_rank: Regular Contributor
timestamp: May 15, 2016, 12:43:40 pm
content: As discribed before a reciprocal counter is classified by this calculation: f = Nin * F_CLOCK / Nref.No matter which kind of counters are used.If you like it, you can even measure your heartbeat in reciprocal way:starting a timer at first beat, counting beats in mind and stop the timer after some seconds synchronously with the last beat.Even mental calculation is possible and you will get an accurate true reciprocal result (3 digits in less then 10 s ;-)Quote from: Liv on May 15, 2016, 10:49:38 amNo!A prescaler will handle all frequencies as desired without any loss of resolution or accuracy.But as I see, it makes no sence to show further code with full implementation of automatic prescaler selection.

author: dannyf
author_rank: Super Contributor
timestamp: May 15, 2016, 12:49:18 pm
content: "before a reciprocal counter i"As you are counting continuously (by time stamping the incoming pulse train), it doesn't matter if you are counting reciprocally or directly.Continuous counting is more advanced than reciprocal counting (better suited for low frequency) or direct counting (better suited for high frequency).

author: Liv
author_rank: Regular Contributor
timestamp: May 15, 2016, 01:42:03 pm
content: Quote from: mino-fm on May 15, 2016, 12:43:40 pmI understand that the use of prescaler can solve the problem of the frequency range without loss of resolution. But this solution has a number of disadvantages - the delay to determine the prescaler ratio, the limitation on the intensity of the other interrupts in the system, etc. Using software counting of input pulses reciprocal counter simply realized on AVR or STM. But it is interesting to build a true reciprocal frequency counter, which would use only the timers without real-time software processing.

author: mino-fm
author_rank: Regular Contributor
timestamp: December 01, 2016, 01:24:44 pm
content: Quote from: Liv on May 15, 2016, 01:42:03 pmUsing STM32F4xx you can take two timers: one for counting ext. pulses and the other one for counting internal Fref.Adding a dual D-type flip-flop will synchronize ext. pulses and Fref on request and will generate a common capture signal to both timers (timestamp). TIM2 and TIM5 are 32-bit counters so you don't need any interaction of software (or any prescaler) for frequencies from 0,05 Hz to ~42-90 MHz. (42 MHz ..F407 @168 MHz; 90 MHz ..F427 @180 MHz)Actually I'm trying to add a discrete time-to-digital converter (TDC) to the circuit described above to get a finer resolution <= 100 ps and to get results of 10 digits/s. Maybe this will work as expected - maybe STM32F4xx will be to noisy.

author: Liv
author_rank: Regular Contributor
timestamp: December 01, 2016, 02:26:19 pm
content: Quote from: mino-fm on December 01, 2016, 01:24:44 pmBy adding external logic, the problem is solved. But an elegant solution - it is no external logic. Input frequency is fed to pin of the controller - and all.Quote from: mino-fm on December 01, 2016, 01:24:44 pmI tried to doTDCas an addition to the AVR. But I did not need a resolution better than 1 ns. The noise level was below 1 ns.

author: mino-fm
author_rank: Regular Contributor
timestamp: December 01, 2016, 03:53:34 pm
content: Quote from: Liv on December 01, 2016, 02:26:19 pmI understand. You like to snap your fingers and like a rainbow you can see the result by looking in the sky?An elegant solution indeed.

author: mino-fm
author_rank: Regular Contributor
timestamp: December 31, 2017, 05:30:27 pm
content: Quote from: mino-fm on December 01, 2016, 01:24:44 pmAs announced one year ago, I finished the development of a 2 channel reciprocal counter with 10 digits/s on main channel. The second channel offers 8 digits/s. It can be used separately or to stabilize the internal or external 10 MHz reference clock by 1pps GPS-signal down to 0.1 ppb.Both channels work from 1 mHz up to 80 MHz directly. An external prescaler (i.e. MC12080) can extend the range up to 1.5 GHz.For faster tests channel 1 makes up to 1000 meas./s with 7 digits resolution continously or single shot with external trigger.Take a look at the circuit diagram.Further pictures (german information) can be found here:http://mino-elektronik.de/FM_407/fmeter_407.htm#c3

author: David Hess
author_rank: Super Contributor
timestamp: January 01, 2018, 01:15:30 am
content: Quote from: rqsall on January 14, 2016, 10:55:12 amThings you might add:1. Slope and level/sensitivity controls.2. Input coupling options.3. Input protection. This one is interesting if you want to add input protection to a 50 ohm input.4. Input bandwidth limiting.5. Input attenuation options.6. A high impedance input so standard oscilloscope probes may be used or the frequency counter may be attached inline.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 01, 2018, 04:43:15 pm
content: An high impedance input that can be used inline with a standard 1 M scope input is kind of difficult, as there is usually one very little spare capacitance for compensation. So the input would need to be very high impedance. Many DSOs also already include a kind of counter function. Some of the older analog scopes have an analog signal output, that could be used for the counter.The more likely way would be an extra output to monitor the signal after an high impedance input stage (e.g. JFET based buffer, just like in most scope inputs) of the counter.To make it a full counter instrument the input section is kind of still missing, but it's kind of OK to have this on a second board. It might be interesting for someone with good RF knowledge to design such an input stage, as the digital part looks really promising.

author: David Hess
author_rank: Super Contributor
timestamp: January 02, 2018, 12:40:47 am
content: Quote from: Kleinstein on January 01, 2018, 04:43:15 pmI meant inline of a low impedance transmission line like with a BNC-T adapter.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 02, 2018, 09:55:33 am
content: Quote from: David Hess on January 02, 2018, 12:40:47 amAdding a second amplifier in parallel to the scope input would cause more trouble than good - at least it would be very tricky to make it super high impedance (e.g. < 5 pF) and not causing high frequency distortion. It might work if you accept something like reducing the overall input impedance to lets say half. So a 1:10 probe would change to a 1:20 probe. Still imperfections of the counters input would limit the useful BW for the scope.

author: David Hess
author_rank: Super Contributor
timestamp: January 02, 2018, 02:48:09 pm
content: Quote from: Kleinstein on January 02, 2018, 09:55:33 amIt is not usually done to oscilloscope input and it is no different than using a high impedance oscilloscope input on a 50 ohm transmission line to do the same thing. Distortion at higher frequencies is less of a concern because high impedance inputs would not be used anyway where that matters. For example most high impedance counter inputs only operate to about 100 MHz and it is rare for them to operate at 200 MHz and higher.There was a good example in another recent discussion about using chained high impedance inputs along a 50 ohm transmission line for distributing a frequency reference. Attaching a high impedance counter or oscilloscope input is the same thing.There is a way to do what you describe though to a low impedance transmission line or at least there used to be. BNC-T and GR-874-T to probe tip adapters used to be available which allowed attaching a high or low impedance probe inline to a transmission line. The attenuation of the probe lowered the input capacitance and the construction minimized the stub length. Essentially it was a way to turn an oscilloscope probe into a signal pick-off although it would also be useful in place of a terminated probe tip adapter for probe calibration. Tektronix even made these for their active probes. Feedthrough sampling heads can be built this way as well.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 02, 2018, 06:12:45 pm
content: Quote from: cncjerry on January 13, 2016, 09:02:17 pmI also bought one of those with an integrated tcxo. It compared very favorably with a lab frequency counter worth over $600.Of course it doesn't have a sophisticated input stage and is not particularly well protected, but you can't beat the price.

author: David Hess
author_rank: Super Contributor
timestamp: January 02, 2018, 07:53:08 pm
content: Quote from: SiliconWizard on January 02, 2018, 06:12:45 pmWhen you get up to 12 digits or low increments of time, the analog and digital circuits before the counter can bias to the readings is subtle ways which require attention in design. Frequency stability of the reference is not sufficient by itself.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 02, 2018, 08:26:09 pm
content: Quote from: David Hess on January 02, 2018, 07:53:08 pmThat's for sure. We were basically answering the author who wanted to build a "simple cheap microcontroller frequency counter circuit".And unless it's meant as a design exercise, he'd be hard-pressed to do better than this and if he did, that would cost a lot more.