Author Topic: Extending a 1ns pulse  (Read 2736 times)

0 Members and 2 Guests are viewing this topic.

Offline WatchfulEye

  • Regular Contributor
  • *
  • Posts: 110
  • Country: gb
Re: Extending a 1ns pulse
« Reply #25 on: February 12, 2024, 04:06:10 pm »
Could you use a dedicated interval timer IC?

TDC7200 is cheap and easily available and easy to interface to. It contains an 18 GHz counter and automatically self calibrates to an external clock (eg. 10MHz OCXO) on each measurement.

These ICs easily get sub 100ps measurement standard deviation.
 
The following users thanked this post: BreakingOhmsLaw

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3722
  • Country: us
Re: Extending a 1ns pulse
« Reply #26 on: February 12, 2024, 04:06:40 pm »

So i'm considering preceding that multivibrator with a fast D-type flip-flop like the 3GHz SY10EP51 and feed the pulse into its clock input. That part will work down to ~320ps pulse with, so that should be fine. Resetting the flip-flop again would be done by the multivibrator to "arm" it for the next pulse.

That should work, but does anyone know of a better or more elegant solution?

No need for the monostable in this case or to reset the flip flop.  Just configure the DFF as a divide by 2 counter to get a square wave and then look at both the rising and falling edges.
 
The following users thanked this post: BreakingOhmsLaw

Online BrianHG

  • Super Contributor
  • ***
  • Posts: 7746
  • Country: ca
Re: Extending a 1ns pulse
« Reply #27 on: February 12, 2024, 04:08:51 pm »
What's wrong with using a single NPN transistor, 2 resistors and 1 or 2 cap?

Note that even a really fast transistor used as a switching amp will take the ~1ns pulse at the base turning on virtually immediately, but because of their slow switch off time, the output will become >10ns at the collector, >15ns for a cheap small signal transistor.
 

Offline BreakingOhmsLawTopic starter

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: de
  • Certified solder fume addict
Re: Extending a 1ns pulse
« Reply #28 on: February 12, 2024, 04:17:18 pm »
Any school should have an oscilloscope for the physics classes.  Nothing can beat "seeing" the results as a waveform.
[...]
I absolutely agree. And they do have some have scopes actually. The problem here is: This experiment is done in 6th grade (ages 11-13). So your conditions look like this:
 - You have a time frame of 45 minutes  (1 "school hour")
 - The students have not learned about electricity yet, so an instrument displaying voltage over time is a very abstract thing.
 - Setting up the experiment cannot consume much time (could be done with reading a preset made by the teacher though)

As an EE, of course i would like everybody to learn about an oscilloscope. But for this experiment, you just don't have the time to learn how to work with a scope. And with the timeframe given, you cannot be side-tracked to learn another, unrelated skill, to be able to perform the experiment that is meant to learn about the actual topic.
I wouldn't give this a second though if wee were talking about university students, but in a middle school scenario, this doesn't work well. Here you need pre-chewed, ready-to-go equipment that can be set up in 2 minutes and get going.

I've been supporting the school with STEM related stuff for several years now, and the one lesson that I've learned is that making knowledge as accessible as possible is very, very hard. Much harder than the engineering part actually. Much of the knowledge we take for granted just isn't there. Voltage? dunno! Waves? dunno! Reflections? dunno!
There's a German company named PHYWE who make this kind of stuff for schools. Their stuff is designed like that too. Inputs that will take any amount of abuse, built like a tank because it can and will fall, huge displays that can be read from 20m away, stuff like that. Of course the pricing reflects that.
So me and a bunch of other parents have started making stuff, repairing stuff that broke down, raise funds to acquire new equipment and so on.  Now, all of that should be provided by our government, but as you can probably guess, it isn't. The town I live in has a lot of debts, and budgets are always small.
 

Offline BreakingOhmsLawTopic starter

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: de
  • Certified solder fume addict
Re: Extending a 1ns pulse
« Reply #29 on: February 12, 2024, 04:19:14 pm »
Could you use a dedicated interval timer IC?

TDC7200 is cheap and easily available and easy to interface to. It contains an 18 GHz counter and automatically self calibrates to an external clock (eg. 10MHz OCXO) on each measurement.

These ICs easily get sub 100ps measurement standard deviation.
That looks very interesting, I'll take a look at that. Thanks!
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3722
  • Country: us
Re: Extending a 1ns pulse
« Reply #30 on: February 12, 2024, 04:20:21 pm »

So i'm considering preceding that multivibrator with a fast D-type flip-flop like the 3GHz SY10EP51 and feed the pulse into its clock input. That part will work down to ~320ps pulse with, so that should be fine. Resetting the flip-flop again would be done by the multivibrator to "arm" it for the next pulse.

That should work, but does anyone know of a better or more elegant solution?

No need for the monostable in this case or to reset the flip flop.  Just configure the DFF as a divide by 2 counter to get a square wave and then look at both the rising and falling edges.

And if the MCU timer can't count both rising and falling edges, have it count only the rising edges of the now 2 MHz clock, and the when reading the result after the STOP, you use the level of the DFF as the 9th bit of your counter chain.
 
The following users thanked this post: BreakingOhmsLaw

Offline BreakingOhmsLawTopic starter

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: de
  • Certified solder fume addict
Re: Extending a 1ns pulse
« Reply #31 on: February 12, 2024, 04:23:49 pm »
No need for the monostable in this case or to reset the flip flop.  Just configure the DFF as a divide by 2 counter to get a square wave and then look at both the rising and falling edges.

The STM32's timer cant be configured to count both edges AFAIK, but I could just set up two parallel input pins & timers, one set to rising, one to falling, and then just add their values. Adding this to my list of things to try. Thanks!  :-+
 

Offline BreakingOhmsLawTopic starter

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: de
  • Certified solder fume addict
Re: Extending a 1ns pulse
« Reply #32 on: February 12, 2024, 04:26:01 pm »
And if the MCU timer can't count both rising and falling edges, have it count only the rising edges of the now 2 MHz clock, and the when reading the result after the STOP, you use the level of the DFF as the 9th bit of your counter chain.
Hmm, I don't see why that shouldn't work. On the list it goes. Thanks mate!
 

Offline BreakingOhmsLawTopic starter

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: de
  • Certified solder fume addict
Re: Extending a 1ns pulse
« Reply #33 on: February 12, 2024, 04:32:42 pm »
My suggestion is to just use a fast ECL flip flop (for example MC100EPT51), data input tied high, clocked by the negative pulse, with an RC feedback network from its Q to its reset pin, that sets the duration of the output pulse. I have done it multiple times and in works to stretch/shrink pulses, although you might have to try a few R-C values to get the pulse duration you want.
You know, that looks like a really good and simple solution. Definately simulating this! Thanks!
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1549
  • Country: au
Re: Extending a 1ns pulse
« Reply #34 on: February 12, 2024, 05:26:57 pm »
..The detector creates a short pulse when a certain intensity threshold is met.
The optical input for both detectors is an optic fibre of different lengths. Input B fibre is typically >100m longer.
The TI time interval part sounds the best and easy to service solution.
Another approach is to shift to the frequency domain by making the delays part of an oscillator loop, although that needs manual swaps of the two different cables, it does eliminate detector skew errors.
Measuring frequency is of course easy. Can even be done with a sound card with scaling.

There are also sub-ns dT measurements possible using a charged cap and an ADC.
Those analog circuits need a calibrate step using known pulse widths
« Last Edit: February 12, 2024, 05:45:02 pm by PCB.Wiz »
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3711
  • Country: nl
Re: Extending a 1ns pulse
« Reply #35 on: February 12, 2024, 06:17:01 pm »
The setup I have in mind does not use CPU power while running. It needs to be setup and then it takes care of itself. It will require dedicated pins to be free though. It is an interesting challenge.  8)
It certainly is. And it would probably mean falling asleep on the Cortex-M3 reference manual for several days  ::)
At my regular hourly rate, It'd probably be cheaper to just spend the extra €60 in my BOM to cascade three more 8-bit ECL timers to end up with a true ECL 1,5GHz 32-bit counter  ;D

For sure the extra hardware will be cheaper then hourly rates for software development even if it is only two.

The solution is rather simple with the one pulse mode the timers have and use external trigger to start it.

Code: [Select]
TIMx_CR1  = 0x0008;   //Enable one pulse mode
TIMx_CR2  = 0x0000;
TIMx_PSC  = 0x0000;
TIMx_CNT  = 0x0000;
TIMx_ARR  = 0x0008;  //Stop after 8 clock pulses
TIMx_CCR1 = 0x0004;  //Make output high after 4 pulses
TIMx_CCER = 0x0001; //Active high output
TIMx_CCMR1 = 0x0070; //PWM mode 2
TIMx_SMCR = 0x0060; //Set ETRF as external trigger (Active high)
TIMx_SMCR |= 0x0006; //Select external trigger mode. Needs to be done after selecting the external trigger to avoid spurious triggers.

For timer 3 ETRF is on pin PD2 and CH1_OUT is on PA6

I have not checked it on an actual MCU.

Offline Smokey

  • Super Contributor
  • ***
  • Posts: 2597
  • Country: us
  • Not An Expert
Re: Extending a 1ns pulse
« Reply #36 on: February 12, 2024, 06:45:06 pm »
Microchip CTMU?

https://www.microchip.com/content/dam/mchp/documents/parked-documents/CTMU%2001375a.pdf

https://ww1.microchip.com/downloads/en/DeviceDoc/61167B.pdf

The oscilloscope demo makes a really great visualization for speed of light measurement.  I feel like that's way better than a microcontroller dumping out a number (which we already know the value of anyway).
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3711
  • Country: nl
Re: Extending a 1ns pulse
« Reply #37 on: February 13, 2024, 06:48:18 am »
Overnight it came to mind that you don't need additional hardware and can use the msb of your ECL counter, which at 8MHz can be used to clock a timer.

According to the timer cook book the external clock can be at max 1/3 of the timer internal clock. They have an example that uses 10MHz as an external clock, so 8MHz should work too.

Offline Marco

  • Super Contributor
  • ***
  • Posts: 6723
  • Country: nl
Re: Extending a 1ns pulse
« Reply #38 on: February 13, 2024, 12:54:57 pm »
That should work, but does anyone know of a better or more elegant solution?
A diode and RC decay?
 

Offline jonpaul

  • Super Contributor
  • ***
  • Posts: 3366
  • Country: fr
Re: Extending a 1ns pulse
« Reply #39 on: February 13, 2024, 01:15:24 pm »
 Bravo , excellent science experiment

See  Fizeau Foucault  speed of light experiment, original papers and   Scientific America  etc.

~ 1 nS per foot thus for accurate measurement, need   very long path ~ 1 km or picosec res.


With diode  lasers and interference patterns, no need for picosecond res.

Jon
Jean-Paul  the Internet Dinosaur
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5913
  • Country: es
Re: Extending a 1ns pulse
« Reply #40 on: February 13, 2024, 01:24:10 pm »
How about a 1n4148 and a small cap?  I know, it's a 1ns switching diode, probably won't work...
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline BreakingOhmsLawTopic starter

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: de
  • Certified solder fume addict
Re: Extending a 1ns pulse
« Reply #41 on: February 13, 2024, 03:04:20 pm »
Overnight it came to mind that you don't need additional hardware and can use the msb of your ECL counter, which at 8MHz can be used to clock a timer.

According to the timer cook book the external clock can be at max 1/3 of the timer internal clock. They have an example that uses 10MHz as an external clock, so 8MHz should work too.
MSB will go high as soon as it hits 0x80. I need a pulse when it goes from 0xFF to 0x00.
 

Offline BreakingOhmsLawTopic starter

  • Frequent Contributor
  • **
  • Posts: 359
  • Country: de
  • Certified solder fume addict
Re: Extending a 1ns pulse
« Reply #42 on: February 13, 2024, 03:11:14 pm »
~ 1 nS per foot thus for accurate measurement, need   very long path ~ 1 km or picosec res.
I think you got your calculation wrong. Speed of light in a optic fibre is about 210.000.000 m/s. So 100 meters gives us a runtime of 476ns. Good enough for <1% accuracy, no need for a picosecond resolution.
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3722
  • Country: us
Re: Extending a 1ns pulse
« Reply #43 on: February 13, 2024, 03:30:56 pm »
Overnight it came to mind that you don't need additional hardware and can use the msb of your ECL counter, which at 8MHz can be used to clock a timer.

According to the timer cook book the external clock can be at max 1/3 of the timer internal clock. They have an example that uses 10MHz as an external clock, so 8MHz should work too.
MSB will go high as soon as it hits 0x80. I need a pulse when it goes from 0xFF to 0x00.

You invert the MSB to chain on the falling edge of the high speed counter.

It's a ripple counter so there will be glitches while running but if you only read the result when stopped it should be fine.
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5913
  • Country: es
Re: Extending a 1ns pulse
« Reply #44 on: February 13, 2024, 03:37:23 pm »
How about making a repetition counter making i.e 128 pulses through the fiber, feding a counter that latches after that number.
The stm32 counts all this time, then the final time is obtained with a simple division. So you don't need such crazy low resolution.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1549
  • Country: au
Re: Extending a 1ns pulse
« Reply #45 on: February 13, 2024, 05:59:13 pm »
Overnight it came to mind that you don't need additional hardware and can use the msb of your ECL counter, which at 8MHz can be used to clock a timer.

According to the timer cook book the external clock can be at max 1/3 of the timer internal clock. They have an example that uses 10MHz as an external clock, so 8MHz should work too.
MSB will go high as soon as it hits 0x80. I need a pulse when it goes from 0xFF to 0x00.
Not quite.
You need an edge, not a pulse.
If your MCU lacks a choice of rise or fall, you can just invert the 8MHz
 

Offline bson

  • Supporter
  • ****
  • Posts: 2270
  • Country: us
Re: Extending a 1ns pulse
« Reply #46 on: February 13, 2024, 07:20:29 pm »
You can extend it with an SR latch and a shift register.  The pulse hits S and output goes high, is clocked into the shift register.  The shift register bit 0 goes high, and this is connected to the STM32 input.  Bit 7 (or any other bit) of the shift register is connected to the latch R input, and clears it.  Now 0's are clocked in until the next pulse on S.

Edit: hmm, even LVC logic (SR latch based on a dual NOR gate) won't work reliably with a 1ns pulse...

I wonder if a Schottky diode could be used as a detector to extend the pulse?
« Last Edit: February 13, 2024, 07:53:32 pm by bson »
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3711
  • Country: nl
Re: Extending a 1ns pulse
« Reply #47 on: February 13, 2024, 07:57:51 pm »
Overnight it came to mind that you don't need additional hardware and can use the msb of your ECL counter, which at 8MHz can be used to clock a timer.

According to the timer cook book the external clock can be at max 1/3 of the timer internal clock. They have an example that uses 10MHz as an external clock, so 8MHz should work too.
MSB will go high as soon as it hits 0x80. I need a pulse when it goes from 0xFF to 0x00.

Only use 7 bits of your counter and the rest from the STM timer. I assume the msb will toggle with a rate of 8MHz as long as the counter keeps on running. So the moment your counter goes up from 0x7F to 0x80, the STM timer goes up to 1. The moment your counter gets there again the STM timer becomes 2, etc.

The moment the second photo detector is activated read the counter value and combine it with the state of the STM timer.

Offline KE5FX

  • Super Contributor
  • ***
  • Posts: 1894
  • Country: us
    • KE5FX.COM
Re: Extending a 1ns pulse
« Reply #48 on: February 13, 2024, 07:59:50 pm »
Students that perform this experiment are typically 11-13 years old. A scope with 30+ buttons is a very daunting piece of equipment cool as hell

Fixed it for you...
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1549
  • Country: au
Re: Extending a 1ns pulse
« Reply #49 on: February 13, 2024, 09:21:13 pm »
How about making a repetition counter making i.e 128 pulses through the fiber, feding a counter that latches after that number.
The stm32 counts all this time, then the final time is obtained with a simple division. So you don't need such crazy low resolution.
Yes, multiple readings with either a random phase or a carefully walked phase, is the low cost engineers approach.

That said, I rather like the 'easy to explain' simplicity of a 1GHz fast clock for a teaching set-up.

I'm not sure everyone has a 1GHz OCXO, but I do see 1GHz oscillators are stocked and not that expensive.

Also keeping things simple, I see prescaler parts like onSemi MC12080 in SO8 are available and not that expensive, that does ÷10, ÷20, ÷40, or ÷80, so gets 1GHz to MCU ballparks.

Those parts are cheap but simple, with no reset or parallel read, but you can MUX/gate the clock in, and use the MCU to read/prime the registers, each time.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf