Timer interrupt variation(TIM1) not exactly as configured, and hence PWM switching time variation
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