cancel
Showing results for 
Search instead for 
Did you mean: 

Timer interrupt variation(TIM1) not exactly as configured, and hence PWM switching time variation

MChau.2
Associate

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

1 REPLY 1

Read out and check/post the RCC and TIM registers content.

How and where do you measure the PWM period?

JW