This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Tobby,
The process described here (turn-off TBCLKSYNC, configure PWM, turn-on TBCLKSYNC) should be used for PWM initialization. In the 'configure PWM' step, you could write to the TBCTR register to set an initial value for the counter. When TBCLKSYNC is set to 1, the PWM counter will start counting from this initial value.
You can get fixed phase shift between multiple PWMs by following this initialization sequence:
1. Enable PWM module clocks in PCLKCR1 register. Do this for all PWM modules you are planning to use.
2. Set TBCLKSYNC to 0.
3. Configure PWM registers (prescalers, PWM modes). Set initial TBCTR value. Do this for all PWM modules you are planning to use. The initial value will decide the phase shift between PWM modules.
4. Set TBCLKSYNC to 1.
I hope this helps.
Hrishi