Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/03/04 15:44
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#75342 - RE: measure pulse width 0.12 ns resolut
Responding to: ???'s previous message
Could you maybe reveal what kind of application requires such resolution? I can imagine some ultrasound or reflected light distance measurement...
Does it have to be so precise over the whole range? Maybe you could replace it with exponential variation so you get the 0.12ns resolution for pulses below 100ns, and only 100ns for 100ms pulses? Or maybe there is some rough hint to the length of the next pulse? What reliablity of the measurement do you need, so i.e it can be repeated on failure? How often do the pulses arrive?

Note the 100ns will be over 800.000 counts if you use your standard "count clocks" approach.

What approach I'd imagine where a '51 COULD work (with huge amount of luck) if the pulses come relatively rarely, not more often than, say, once in 16us:

Split the 100us into smaller sequences of, say, 2us which you count in a "major" counter. Then integrate the signal over the 2us period by charging a capacitor, then measure the voltage in the capacitor at the end of the period using a precise, fast ADC. 100% means it hasn't ended yet and the procedure has to be repeated, anything less - after scaling down gives you the "fraction" to add to the "major" counter.
With a 16bit ADC you get 64k values, multiplied by 50 2ms units gives over 3.000.000 "units".

2us is not a whole lot for an ADC to perform its job, even though a fast MCU gets some 60 cycles then, plus before next measurement you have to discharge the capacitor. So you'd have to streamline the measuring/charging/discharging. For example I'll show how it could be done with 8 readout devices: At any given moment 1 such device is charged, 5 measure through 5 (out of 8) separate ADCs, 2 capacitors are being discharged.
A cycle for each of them would be 2us of charging, 10us of measuring, 4us of discharging. The device would consist of an 8-channel switch (multiplexer) redirecting the input to one of 8 devices, 8 capacitor-ADC pairs with some driving gates (function choice: charging/measuring/discharging) and a micro to drive them all. They all would be working simultaneously each taking 16us to perform whole "cycle" in time offset from other device by 2us.

MCU work:
Initialize the cycle.
Start:
Wait for tick.
Switch input to newly discharged capacitor.
Switch just measured capacitor to discharging.
Switch on ADC on a capacitor that has just been charged .
Poll the last ADC in queue for "ready" signal".
Read the value.
If equal 0%, still no signal, go to "Start".
Else:
Remember the ADC value (as startup value)
Reset the counter.

Stop:
Wait for tick.
(as before)...
Switch input to newly discharged capacitor.
Switch just measured capacitor to discharging.
Switch on ADC on a capacitor that has just been charged .
Poll the last ADC in queue for "ready" signal".
Read the value.
If equal 100%, increase counter by one, loop to Stop.
Else:
Save the value.
Check startup value and stop value against look-up table, filled with experimentally measured ADC values for known pulse lengths. Add times corresponding to them to time corresponding to number of ticks in the counter.
Do whatever you want with the calculated time.
Loop to start.

There's a fencepost problem concerning the delay between event (pulse start/end) arriving and being found, clock ticks in the meantime so you need to think about it.

You'd probably need quite a chunk of EEPROM for almost 64k possible 2-byte values of -each- ADC (you need to take production differences between parts, i.e. two 1uF capacitors may be really one 998nF and the other 1002nF so you need to calibrate each device separately) and for separate sets of conditions (startup run, stop run, less than 2us pulse (<1 tick) etc.)


List of 26 messages in thread
TopicAuthorDate
measure pulse width 0.12 ns resolution            01/01/70 00:00      
   RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
      RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
         RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
            RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
               RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
                  RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
                  RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
   RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
   RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
      RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
         RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
      RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
   RE: measure pulse width 0.12 ns resolution            01/01/70 00:00      
      RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
         RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
            RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
               RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
               RE: measure pulse width 0.12 ns resolut            01/01/70 00:00      
               Is it used for auto-calibration routine?            01/01/70 00:00      
                  RE: Is it used for auto-calibration routine?            01/01/70 00:00      
                  RE: Is it used for auto-calibration rout            01/01/70 00:00      
                     RE: Is it used for auto-calibration rout            01/01/70 00:00      
                        RE: Is it used for auto-calibration rout            01/01/70 00:00      
                  RE: Is it used for auto-calibration rout            01/01/70 00:00      
                     RE: Is it used for auto-calibration rout            01/01/70 00:00      

Back to Subject List