cancel
Showing results for 
Search instead for 
Did you mean: 

How to set delay between two timers?

SGold.3
Associate II

I have two signals, one I would like to output for the first 950 ms of every second and then a second signal that I would like to output at a variable start time of each second. I included my code (the delay function does not work) for reference if that helps.

8 REPLIES 8

Draw a timing diagram, showing the expected waveforms, indicating the fixed and variable parameters.

JW

SGold.3
Associate II

Working off this diagram, what I want fixed is the Trig Pulser which is outputting a 10 kHz signal for the first 38/40 of a second. Then the variable parameter is Trig Laser which I want to output a 445 microsecond pulse twice per second 25 ms apart at varying times in the last 2/40 of the second. In my code, I am using a master clock in Timer15 with Trig Pulser as TIM1 and Trig Laser as TIM8.

Thanks,

Sam

TDK
Guru

Create one timer which does the 0.445/25 duty cycle and 25ms period, and then drive it in gated mode using a master timer which has a 2/40 duty cycle and 1s period.

If you feel a post has answered your question, please click "Accept as Solution".
SGold.3
Associate II

So I have that already, the problem is the signal starts at the 0 seconds and triggers every second on the second. I was hoping to have the signal trigger twice at say 955ms and then twice again at 1964ms. Does that make sense?

Adjust the starting counter value of the master timer for where in the period you wan1t it to start.
If you feel a post has answered your question, please click "Accept as Solution".

Is there a diagram I don't see?

JW

TDK
Guru

What would the command be to do this?