Enthernet Code
DIIDevHeads IoT Integration Server
•Created by Sterling on 10/2/2024 in #firmware-and-baremetal
Trouble Generating PWM Signal on STM32 NUCLEO-F207ZG Using Low-Level Register Programming
You're welcome @Sterling
Yes, the missing prescaler could indeed be contributing to the issue. Without setting the prescaler, the timer may be running too fast for the desired
PWM
frequency, resulting in no visible effect on the LED
. Try setting an appropriate prescaler based on the system clock and the desired PWM
frequency.
As for the preload settings, you’ve enabled the preload for TIM1
with the line TIM1->CCMR1 |= BIT3;
. This looks correct, but ensure that you also enable the auto-reload preload if you want the ARR
to be updated smoothly without glitches during operation. You can do this by setting the ARPE
bit in TIM1->CR1
( TIM1->CR1 |= BIT7;
).4 replies