Arduino-FOC icon indicating copy to clipboard operation
Arduino-FOC copied to clipboard

STM32 PWM generation on TIM14/TIM15/TIM16 has double frequency

Open runger1101001 opened this issue 3 years ago • 0 comments

TIM14/TIM15/TIM16 seem to be a special case, maybe some of the other high-number timers too. They wind up with double the frequency - so the PWM is correct, but with double frequency to the other timers.

This bug exists on both master and dev branches (i.e. in both original and refactored STM32 drivers)

Here the result of: BLDCDriver3PWM driver = BLDCDriver3PWM(PB8, PA10, PB3); on a STM32L433: image Note that phase A is the top channel, with 20µs period, which is on TIM16. The other two phases are on TIM1 and TIM2.

I had similar results with TIM14 on STM32G031 and TIM15 on STM32G474, so I think it has to do with these timers.

runger1101001 avatar Apr 03 '22 22:04 runger1101001