Associate II
August 2, 2023
Question
STM32WL PWM start and stop issue
- August 2, 2023
- 1 reply
- 1465 views
Hi All,
I've configured TIM1 and TIM2 of my board (STM32WL55JC1) CH1 of both TIM to PWM output which is synchronized by output compare of TIM1 CH2, its working well for the first run then I stop PWM for 5 minutes by following commands:
HAL_TIM_OC_Stop(&htim1, TIM_CHANNEL_2);
HAL_TIM_PWM_Stop(&htim2, TIM_CHANNEL_1);
HAL_TIM_PWM_Stop(&htim1, TIM_CHANNEL_1);
And turn on again via the following commands:
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);
HAL_TIM_OC_Start(&htim1, TIM_CHANNEL_2);
But when I run PWM again they don't sync anymore (see following picture from first run and after stop and start )
Any ideas how to stop PWM and start and they will be sync again?