Which is the best way to measure low frequencies?

Apr 17, 2006 5 Replies

Hallo, I should measure the frequency of an input signal. Max frequency of signal is 100 KHz.



I have made a simple system to detect rising edge of input signal using a flip flop. It samples the input signal every system clock cycle. To measure the input frequency I count the number of system clock periods between two rising edges of input signal.



To test the system I' using a function generator.



Reading the data acquired (using a fixed frequency) I have watched that every 5-10 datas there is an error. The number aquired is about 50% or 75% less than the others.



Using a pull up resistor will be solved the error?



Otherwise I need a system that verify glitches?


Marco

On a sunny day (Mon, 17 Apr 2006 16:59:07 +0200) it happened "Marco T." wrote in :

Hard to tell what your error source is. But in all cases you need to make a fast rise clean pulse. You need a Smitt-trigger. Basically an opamp with some positive feedback.

If you want to measure 100 kHz with 1% accuracy, you need to count the incoming pulses for at least 1 millisecond. Or you can measure the 10 microsecond period length, if you have a clock available that is faster than 10 MHz.

Measuring for a longer time reduces the impact of signal rise time and jitter, but requires a counter to establish the ms time base.

This is all covered in hundreds of text books... Peter Alfke

For more precsiion, you can divide the Fu, before doing the time capture. Or, you can set up to capture a wide-timebase counter, and NOT reset the counter between captures - then you have the option to choose Cycles in SW, and the time is done by subtract, and you do not loose any time-ticks, so have best precision.

50% less is explained by false triggers on the wrong edge, 75% less is harder to explain, unless you are over more than one cycle ?

Hardware solution is to add a Schmitt trigger, and maybe also a RC filter.

SW patch is to read multiple captures, and reject ones that suddenly 'step' from previous readings.

-jg

[... snip ...]

There is a frequency coutner reference design for Spartan-3E Starter Kit board.

formatting link

I'm not sure how low in frequency that you want to go, but it does measure from ~50 kHz to 100s of MHz. It also uses the PicoBlaze 8-bit embedded controller macro.

[ADV]: Spartan-3E Starter Kit board
formatting link
[ADV]: PicoBlaze Controller
formatting link

--------------------------------- Steven K. Knapp Applications Manager, Xilinx Inc. General Products Division Spartan-3/-3E FPGAs

formatting link

--------------------------------- The Spartan(tm)-3 Generation: The World's Lowest-Cost FPGAs.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required