Become a leader in the IoT community!
New DevHeads get a 320-point leaderboard boost when joining the DevHeads IoT Integration Community. In addition to learning and advising, active community leaders are rewarded with community recognition and free tech stuff. Start your Legendary Collaboration now!
To get your PWM signal working on the `STM32 NUCLEO-F207ZG` board, there are a few key things to check:
– Set the Timer Prescaler
– Correct Alternate Function for PE_9.
– Re-check the GPIO settings for speed, output type (push-pull), and ensure there’s no pull-up/down resistor interfering with the signal.
– Make sure the timer clock is correctly enabled and that you’re using the right PWM mode. Also, check if preload is enabled properly.
@ifreakio
Thanks for the tips @enthernetcode .
I’ll review the prescaler, PE_9 alternate function, and GPIO settings. Just to confirm, could a missing prescaler be causing the issue? Additionally, do my preload settings appear correct?
You’re welcome @ifreakio
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;`).
CONTRIBUTE TO THIS THREAD