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.

Stellaris® ARM® LM4F - adjusted PWM period when use Timer In PWM Timing mode

I configure  timer3 timer_B in PWM Timing mode for out put PWM,when it is Enable,the pin our put pwm wave which period and dutycycle have been set befor enable.

but I want to adjusted PWM period when it is running.

so I use ROM_TimerLoadSet() to set period,but "Description:This function configures the timer load value; if the timer is running then the value is immediately loaded into the timer." and it change time value immediately.

the datasheet have description"In PWM Timing mode, the timer continues running after the PWM signal has been generated. The PWM period can be adjusted at any time by writing the GPTMTnILR register, and the change takes effect at the next cycle after the write."

so,how can I do this?which function should be called?

  • Hi,

    TimerLoad Set() uses/modify GPTMTBILR register in your case, so there is not any contradiction.

    Petrei

  • Pardon - agree w/poster Petrei - however changing the "period" of a running PWM signal is very much not, "normal/customary."

    Far more natural would be the regular "update" of PWM Duty Cycle - and this easily accomplished via: "ROM_TimerMatchSet()" - with the final (3rd) parameter being a variable which is altered prior to your calling this function.

  • I have solute this quesqion at last year。

    solution:

      HWREGBITW((TIMER3_BASE + TIMER_O_TBMR), 8) =  1;  //set  TAILD

    then,it works as my want。