cancel
Showing results for 
Search instead for 
Did you mean: 

Stop-start using Master-Slave timer synchronization

primer101
Visitor

Hi Community:

I'm working with an STM32F411C to control a stepper motor that requires 3 PWM signals with a 120° phase shift, using Master-Slave timer synchronization between TIM1, TIM3, and TIM4. The second channel is used to trigger the next timer. When the motor stops, I need to maintain a 20kHz PWM signal with a 75% duty cycle on one winding. Everything functions fine until I need to restart the timers in synchronized mode. I've tried using the HAL_TIM_PWM_Stop and Start pair without success. I also attempted to use DeInit functions and reconfigure the timers, but it's still not working. Any ideas on how to solve this would be greatly appreciated. Thank you!

1 REPLY 1
TDK
Super User

You can use the force/release reset bits for the peripherals to get them to the initial hardware state. If you reinitialize the handles and restart the whole setup after that, it'll work.

If you feel a post has answered your question, please click "Accept as Solution".