cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behavior of PWM

JWilk.1
Associate II

Hello,

I​ am observing a strange behaviour of the first few PWM pulses after a change in duty cycle. I use HAL_TIM_PWM_Stop, HAL_TIM_ConfigChannel (with the changed Pulse) and then HAL_TIM_PWM_Start. What happens is that for around 1 millisecond the pulses are with a strange form (see attached file). If I directly change the CCRx register there is no problem. I try to understand what is happening.

MCU used - STM32F429.

Best regards,

John​

10 REPLIES 10

Can you please post a minimal but complete compilable code exhibiting the problem, to be possibly reproduced elsewhere?

Ideally, if you can get rid of Cube/HAL, using registers directly.

JW