Author Topic: Mircro-controller designs to generate nano second pulses with variable delay.  (Read 1346 times)

BrianHG and 3 Guests are viewing this topic.

Offline dmsc

  • Newbie
  • Posts: 6
Hi!


Please see the attached image. I need 2 sets of pulses with variable delay between them i.e delay between (1,2) and (3,4) is can be fixed (50-100 ns) while I need to have control over the delay between the two sets.


This is exactly the application for the "one-pulse mode" of the STM32 timers, it is available in all the STM32 micros. From the reference manual:

Quote
One-pulse mode (OPM) is a particular case of the previous modes. It allows the counter to be started in response to a stimulus and to generate a pulse with a programmable length after a programmable delay.

By having the timer run at 20MHz (50ns period) you can get all the waveforms you sketched. You use one input and the 4 timer channels to generate each of the 4 outputs.

 

Online radar_macgyver

  • Frequent Contributor
  • **
  • Posts: 724
  • Country: us
Similar timing waveforms are often encountered in radar applications, and are usually implemented in an FPGA or similar. One method I've found handy is to implement a programmable state machine with a block RAM to store the state transitions and the time delay to the next state transition. When the external trigger is received, the state machine starts from the beginning of the block RAM and 'plays back' the stored transitions. Resolutions of 10 ns are easy to achieve on older FPGA families, and 5 ns or shorter on newer ones. The waveform sequence may be easily changed by rewriting the block RAM contents.

One could also do a similar implementation using a memory block (SRAM, EPROM) and a counter.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf