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.

  • Resolved

TMS320F28335: PWM duty cycle update for F28335

Expert 1530 points

Replies: 3

Views: 61

Part Number: TMS320F28335

Hi,

I would like to know if I can change the duty cycle of PWM in the midway of an existing PWM pulse.

My Current scenario:

1. I have one PWM module configure for 50us to generate SOC

2. In 50us, I have the configuration to update the duty cycle of the second PWM module, which will generate the WPM of 200us period.

Let's say I set the duty cycle to 75% on in Time t1, i.e at 0 and then at t+50, i.e at 50us I change the duty cycle to 25% on. Will this reflect on the PWM or, it has to wait for the 200us PWM pulse to complete and change the duty cycle?

Your suggestions are appreciated.

  • Mohan:

    There are shadow registers available, so that the change of duty cycle would happen on the "next" pwm cycle.

    reference: 

    Regards,

    Todd Anderson

  • Mohan,

    Todd's answer is correct. Please enable the shadow registers, this will allow you to write to the registers at any point, then the "shadow value" that you write will take effect at a specific counter event. Usually TBCTR = Period.

    Regards,
    Cody

  • In reply to Todd Anderson78572:

    Thank you Todd Anderson,

    I will explore and use this option.

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.