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.

TMS320F28035: Question about the synchronization of EPWM modules.

Part Number: TMS320F28035
In the datasheet, below picture show the description of TBCLKSYNC 
The question about the above paragraph is, when the first rising edge of TBCLK, does TBCTR start from zero or the initial value of TBCTR (which register is Read/Write)?
I personally understand that it starts with the initial value when the first rising edge of TBCLK. In the Configure prescaler values and ePWM modes step, turns off the synchronization between the EPWM modules.   and the phase of different EPWM modules are moved by the initial value, but it can't  achieve phase shift between EPWMs . so I want to know if this method can achieve a fixed phase shift between different modules. Thank you.
  • If this method can set phase shift, why? Thanks
  • 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

  • Hi Tobby,

    There has been no activity on this thread for almost a month. I am going to mark this post as 'resolved'. Feel free to reject the resolution if you want to reopen it.

    Hrishi