PWM max frequency getting capped in STM32F4 (96b_aerocore2)? #37726
Replies: 1 comment
-
EDIT: I installed Zephyr 2.6.99 to try it, and what seems to be capped is the min period for the PWM, instead of the pulswidth itself. I checked with
In this case, the 100 corresponds to the period in clock cycles, but again, it doesn't go any lower from 10 kHz, suggesting that the clock for the pwm is 1000 KHz. Setting it below 100 clock cycles would drive the pwm to a constant off state. EDIT 2: I also modified the preescaler of the APB1 (the clock that feeds the pwm). And keeping all parameters constant, the pulsewidth would increase or decrease accordingly, but the period would remain unmodified. That means, increasing the preescaler from 4 to 8 would duplicate the pulsewidth, but the period would stay at 100 microsecs minimum |
Beta Was this translation helpful? Give feedback.
-
Hi. I'm trying to drive a motor with a STM32F427VIT6, but I can't go any faster than 8.33 kHz.
I measured this by setting a PWM with a period of 2 cycles, and an active state of 1 cycle:
ret = pwm_pin_set_cycles(pwm, PWM_CHANNEL, 2, 1, PWM_FLAGS);
I tried to measure the amount of cycles per second but it shows zero:
ret = pwm_get_cycles_per_sec(pwm,PWM_CHANNEL,maxp);
The .dts I'm using is based on the 96b Aerocore 2, and I overrode the definition of timers1 in the following way:
And these are the settings that I use in my defconfig file, which were only modified to get a clock of 168 MHz
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions