You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the PWM interrupt handler is delayed by another interrupt using the same or higher priority the PWM can stop working for a long time. The problem can be reproduced using the following example:
I do not know if the problem I'm experiencing is connected to this but strange things happen to the pwm output even if you change the duty cycle during the operation of the pwm. I noticed that if you decrease the d.c. normally nothing happens but if you increase d.c. the pwm signal disappears and may reappear after several seconds.
When this happens, the timer interrupt routine2 is no longer executed. After the infamous seconds it seems that the timer2 overflows and generates the interrupt that restarts the pwm.
I'm using stm32F407 with pwm freq of 1KHz.
I have the impression that "stm32_pwm.c" pwm_callback () does not take into account that pwm_config [i] .dutyCycle has changed even before finishing the full cycle of the pwm.
Perhaps you need to create a local copy of pwm_config [i] .dutyCycle which is then updated only at the end of the pwm cycle.
When the PWM interrupt handler is delayed by another interrupt using the same or higher priority the PWM can stop working for a long time. The problem can be reproduced using the following example:
This screenshot shows that the PWM1 & PWM2 signals stop while the TIMER signal continues to pulse.
The text was updated successfully, but these errors were encountered: