[sdiy] measuring pulse width with ns accuracy...

Magnus Danielson cfmd at swipnet.se
Mon Apr 21 02:03:03 CEST 2003


From: "Bert Schiettecatte" <bert.schiettecatte at esat.kuleuven.ac.be>
Subject: RE: [sdiy] measuring pulse width with ns accuracy...
Date: Mon, 21 Apr 2003 01:40:37 +0200

> hi magnus,

Hi Bert,

> >Which frequencies?
> 
> does that really matter? let's say 25 Mhz or so.

Well, it does help to know which range. In the neighborhood of 25 MHz is about
as much info as I need.

> >In principal this is pretty darn close to what interpolating reciprocal
> counters
> >do, like mine for instance.
> 
> that sounds like total chinese for me :-)

Well, that's why I tried to explain it to you. If you did know about it you
would be asking how to make one, right? ;O)

> >The basic reciprocal counter acts on start and stop signals from the analog
> >front-end. The time between the start and stop events is measured by
> counting
> >the number of reference clock cycles from the start event to the stop
> event.
> 
> but to measurea 3ns interval you need a clock running at 300 Mhz or so?

Yes, if you don't use the analog interpolator trick or some other trick (there
are a handfull of them).

> counters you can buy off the shelf only go up to 170 Mhz or so.

Right.

> >Gate-time prolongs this period so that averaging occurs, but the reciprocal
> >counter checks out how many cycles have occured, so for frequency/period
> >measures proper compensation can be handled.
> 
> Hmm.. I don't really understand this. Can you explain a bit more?

OK.

Here is a rought schetch of a x2 expansion:
               ____      ____      ____      ____      ____      ____
RefClock |____|    |____|    |____|    |____|    |____|    |____|    |____|
                       ______________________________________________________
Start    _____________|
                       ___________
Charge   _____________|           |_________________________________________
                                   _______________________
Discharge_________________________|                       |_________________

We notice that the charging period takes 12/10 = 1.2 cycles, but the discharge
period takes 2.4 cycles. By deciding if it take 2 or 3 cycles we learn if the
original where 0 or 1/2 cycle before the reference clocks rising edge after
the start event. This way we have a time resolution as if we had doubled our
reference counter clock. I chose this low expansion for clarity in a simple
and small ASCII drawing, but the principle works the same. Also, the
Charge/Discharge timing signals may not be really as visible as in the drawing,
but once you've learned the overall theory of the analog interpolator you can
figure out the more obscurated forms too.

Notice that the gate-delay as such is to some degree "hidden", as long as the
delay is fairly stable (constant tune-ups helps to remove much of the errors,
just like hitting the auto-tune button on analogs). The speed of curcuits
should be sufficient to handle the input signal.

> >Now, to get high time precission with a straight counter setup you would go
> >into insane frequencies eventually. But there are tricks around it, many of
> them
> >infact. The winning contender in contemporary counters is analog
> interpolators.
> >They will measure the trime from the start/stop event (as received as a
> signal
> >edge) to the next reference-frequency edge. This is done by charging a
> capacitor
> >with a reference current. Then, the capacitor is discharged with another
> (much
> >lower) current. The time for the capacitor to discharge is measured by a
> >separate counter as a number of clock cycles. By this technique will the
> >pulse-differance be prolonged and the ratio is the ratio between the load
> and
> >discharge currents.
> 
> I'll have to do some thinking about this to fully understand what's going on
> but I can see your point.

Let it melt in. No worries. The trick is a little bit of different thinking, so
if some of the technicalities take some time to understand, it's just natural.

> >Still more methods is at hand, all with their ups and downs. Consult
> frequency
> >control literature to learn more... or ask me ;O)
> 
> well, it's 1:30am here now so I think i'll get some sleep ;-) i'll read your
> email
> again tomorrow and try to understand it better. ah well.. maybe I should
> have studied
> analogue electronics instead of computer science...

Probably. But then, did you think I picked this up in my futile attempt of EE
studies? No. I'm an inherently autodidact person... ;O)

> thanks a lot for your help and suggestions. i'll try to prototype some
> circuits and
> let you know how it goes.

Wonderfull! Good luck!

Hmm... I *should* roll my own too.

Cheers,
Magnus



More information about the Synth-diy mailing list