cancel
Showing results for 
Search instead for 
Did you mean: 

2 PWM with phase shift

udibit
Associate II
Posted on June 28, 2015 at 17:36

Hi,

I would like to generate 2 PWM @ 6KHz, but i would like to have a delay between the PWMs of 5uS.

I thought of using two different timers for the mission (each for each PWM), and just for the first time delay to use a third timer to count up till 5us.

want to say:

TIM2 - start PWM1

TIM3 - timebase for 5uS (then release TIM3).

TIM4 - start PWM2. 

Will the time delay will be kept between the two signals, or should i consider any skew?

Do someone suggest something better?
3 REPLIES 3
Posted on June 29, 2015 at 04:01

Perhaps there's a master/slave timer arrangement, where you can use a higher order channel on one timer as a reset trigger for the other.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
udibit
Associate II
Posted on June 29, 2015 at 12:37

Do you familiar with similar example code?

Posted on June 29, 2015 at 23:10

Not sure I can point to a turn-key example. It strikes me as something doable, but I could spend hours on it, not fun.

You'll need to work through the reference manual for your part, determine which timers pair up, what channels you have spare for triggers, and if your secondary pulse width would get truncated if the timer were reset via a pulse from the primary.

You'd also need to think about if this a continuous signal, or if it's something you need to stop/start, or change the frequency or pulse width.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..