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.

TMS320F28335: How to change the phase of PWM

Genius 3095 points

Part Number: TMS320F28335

Dear Team:

if(objMtr->mtrNum == HAL_MTR1)
{
PWM_disableCounterLoad(objMtr->pwmHandle[0]); // disable phase syncronization
}
else if(objMtr->mtrNum == HAL_MTR2)
{
PWM_enableCounterLoad(objMtr->pwmHandle[0]); // enable phase syncronization
PWM_setPhase(objMtr->pwmHandle[0],(halfPeriod_cycles>>1)); // half PWM period
}

I have change the value of halfPeriod_cycles, But there is no change with the phase difference. Did I choose the wrong variate? Or how can I change the PWM phase?

  • Hello F.F.,
    I'm using the F28379D, but hopefully it is mostly the same for your device.
    Have you looked into using TBCTL[PHSEN] = 1 to enable the phase offset, and then supplying the offset value in register TBPHS?
    I haven't used this myself on the F28379D, but from what I understand, this would allow you to delay the waveform based on the synchronization event (which you are enabling).

    Best regards,
    Tero
  • Hi,
    Are you using any sample code? Can you let me know where are the above used APIs defined?

    Thanks
    Vasudha