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.

TM4C123GH6PM: About using Pwm module, pwm fault when setting pwm width

Part Number: TM4C123GH6PM


Hello,

I would like to ask about using Tiva PWM module.

About setting the Pwm width by using API "PWMPulseWidthSet".

When using Timer PWM module ,as down count mode, and "NO SYNC",and the Pwm cycle = 2500,

if we set the Pwm pulse width to "1" ,using PWMPulseWidthSet(1),

in some cases , Pwm width becomes immediately to zero,and Pwm fault occures ?

And, if we use the Pwm module with Sync mode ,we don't have worry about this issue ?

Hiroyasu

 

  • HI,

      First of all, are you trying to update the pulse width dynamically with a value of 1? Is there any reason why you want to use "NO SYNC"? Can you try the locally synchronization if you are working with one PWM generator? You will use the PWM_GEN_MODE_GEN_SYNC_LOCAL as the flag when you call PWMGenConfigure

    ■ Immediately. The write value has immediate effect, and the hardware reacts immediately.

    Locally Synchronized. The write value does not affect the logic until the counter reaches the
    value zero at the end of the PWM cycle. In this case, the effect of the write is deferred, providing
    a guaranteed defined behavior and preventing overly short or overly long output PWM pulses.