# Measuring the period of a signal

Discussion in 'Electronic Design' started by axr0284, Apr 9, 2007.

1. ### axr0284Guest

Hi,
I am trying to figure out if there is a good way to measure the
period of a signal in an analog fashion. I am not an expert in analog
circuits so bear with me here.

The signal is a sqaure wave that will be between 1MHz and 4MHz. The
signal can change by +- 5% max. I was wondering how to measure the
period of the signal accurately.

I was thinking of cutting the frequency in 1/2. This will cause the
signal to be high for the full period of the original signal. Then I
would use this signal to store energy in a capacitor. This will cause
an increase in voltage across the CAP which can be measure by an ADC
and then fed into a FPGA which would read the digital output to know
the period.

Anybody think this is do-able or far fetch. What might be the issues
that arise in such a design. Lastly is there any chip that already
does this. Thanks a lot.
Amish

2. ### Tim ShoppaGuest

Look up "time to amplitude converter" (TAC) or "frequency to voltage
converter". e.g. LM2917 or LM2907.

Today, if the desire is to get a digital number out, you'd just start
running a timer at one edge and stop at another edge. HP has sold
instruments that do this for a good chunk of a century now. Note that
you do not specify your desired resolution, nor even whether you want
to know period, time high, or time low.

Tim.

3. ### whit3rdGuest

Well, it isn't clear how accurate you want your measurement to be.
If you need high accuracy (1% or better), mostly it's recommended
to use a digital frequency counter. If, on the other hand, your
5% number is the frequency TOLERANCE, consider using a
phase-locked-loop chip. 74HC4046 can lock onto this kind of
signal and has an output pin whose voltage varies linearly
with the frequency it locks to.

With a good quality timing capacitor and some 1% program resistors,
precision is possible. Accuracy follows after you calibrate the
analog
output with some known-frequency sources. Either a calibration
graph, or a gain adjustment to 1.000V/MHz, can be useful.

4. ### colinGuest

one way would be to charge up a capacitor with a constant current source,
then discharge the capacitor with a mosfet with a short pulse at the start
of the period.
then average the value with a low pass filter.

the pulse could be via a cr network, or as you sugest using half the
frequency.

depends how accurate you want it.

If your going to digital anyway why not just simply count the pulses and
work out the period from 1/freq ?

Colin =^.^=

5. ### Robert BaerGuest

Clue #1: the period is the inverse of the frequency.
Clue #2: one can start a counter that is driven from a fixed
frequency at (say) the rising edge, and stop the counter at the next
rising edge.
Clue #3: many frequency meters have that period funcion also, but if
not, refer to clue #1.

6. ### axr0284Guest

Thanks for the answers. I will try to go with the simple counter
first. Hopefully it is accurate enough. If not, i guess i will have to
find a better solution.
Amish

7. ### Anthony FremontGuest

Microcontrollers are good at this kind of thing, but the frequency that you
are talking about is kinda high for low-end parts. For example with a PIC
running at 4MHz, you can easily and accurately measure the length of pulses
to 1uS precision. That's good resolution for lots of things, but for a 5MHz
signal it's unusable. On a larger (read more expensive) you could clock it
at 40MHz and increase resolution to 100nS. Better, but probably still
pretty far from being precise enough for your frequency of interest. I
believe that you can actually acheive 25nS resolution with those models, but
I'm not sure on that. Not that it would help that much.

You probably want pS resolution, so the easiest thing is to just count the
frequency and do the math.

Of course, you may wish to verify this with Mr. Black. ;-)

8. ### colinGuest

Im using a dspic30 wich as you say can be clocked at 40mhz,
but actually this is the instructions per second,
the actual clock is 160mhz from a PLL inside,
although the counter/timers clock of the 40mhz tho so that stil gives me
25ns,
trying to get 0.1ps resolution seems kind of absurd but thats what im trying
todo.

anyone know what other MCU has faster clocking timer/counter ?
if a 2ghz pentium had timer counter now that would be nice

Colin =^.^=

9. ### Robert BaerGuest

You mean to say that you have not heard of the FRDTSC command?