1
votes

I'm using the STM32F767 and have to generate a PWM signal to power a DC motor. I have an interface developed for the user to input the duty cycle and outputs the velocity of the motor. But I can't seem to generate a PWM in interrupt mode, it works as usual with HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);

but with HAL_TIM_PWM_Start_IT(&htim2, TIM_CHANNEL_1); it doesn't function. I don't know if I need to do some callback function.

I'd like some help with this issue or at least some indications on what to study to solve this problem, since I'm not really comfortable with this topic.

Thank you!

1
Hard to tell without knowing your code. Is the interrupt enabled for example?Bence Kaulics
Yes, the interrupt is enabled, what I'd like to know is how to do it generally because I can't seem to find anything online.DiogoJDO

1 Answers

0
votes

You need to implement a callback function in main. You can check stm32f7xx_hal_tim.c file to find suitable callback function to fix your problem.