2020-12-16 07:55 PM
TIM1 is configured for complimentary PWM for three phase motor control.
PWM switching frequency is 4khz i.e. 250us, but i am finding that PWM time is getting varied from 244us to 248us. sometimes 252us.
Is it some calibration issue or what? Can anyone pls suggest.
The crystal is external 16MHz and it get measured exact on scope.
TIM1 : clock 84MHz,prescale value: 7, PWM mode 2: centre aligned mode.
Timer interrupt varies from:244 to 248 us instead of exact 250us.
PWM switching: varies from 244us to 252 us instead of exact 250us(4khz).
Controller: STM32F401VE
2020-12-17 03:38 PM
Read out and check/post the RCC and TIM registers content.
How and where do you measure the PWM period?
JW