AnsweredAssumed Answered

Timer PWM change period on runtime

Question asked by Zarckk on Jun 12, 2017
Latest reply on Jun 12, 2017 by Zarckk

Hi everyone,

 

In my project, I need to generate a PWM with some parameters which need to be changed during runtime.

Here are the parameters : 

- Duty cycle

- Period

- Voltage level (I think this one is not possible... maybe there is an alternative way you may know?)

 

First of all, I generate the PWM without troubles.

I am able to change the duty cycle on runtime using __HAL_TIM_SET_COMPARE(__HANDLE__, __CHANNEL__, __COMPARE__) macro

Now, it is possible to change the period while runtime using this kind of macro? I can't find it.

 

Thank you very much,

Marc

Outcomes