cancel
Showing results for 
Search instead for 
Did you mean: 

STM32-F401RE change duty cycle on the fly

SMusc.1
Associate III

Hi every one; using a STM32-F401RE board , how can i canghe on the fly the period and duty cycle of the two signal got in complementary PWM death time using ARR and CCR register?

2 REPLIES 2
SMusc.1
Associate III

Starting the timer in this way:

HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);

HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_1);

and using this call back:

void HAL_TIM_PeriodElapsedCallback (TIM_HandleTypeDef *htim)

doesn't work

gbm
Lead III

Check if you have enabled the timer interrupt.