Sterling
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
I'm programming an STM32 NUCLEO-F207ZG board and trying to output a PWM signal on pin PE_9 (D6) to drive an LED. I'm using low-level register programming (no HAL/LL drivers). However, the LED is not responding, and I don't see a PWM signal on the pin.
Here's the code I'm using:
I’ve reviewed the STM32 reference manual, datasheet, and application notes. Timer 1 and GPIOE clocks seem to be enabled, and PE_9 is in alternate function mode, though I’m unsure if AF1 (TIM1_CH1) is correctly set. The timer is configured for PWM output, but the prescaler is not set, and I’m uncertain if the timer clock is correct. I haven't verified pin speed, output type, or pull-up/down resistors. Despite adjusting duty cycle and period, the LED remains unresponsive.
Am I missing any key register settings for Timer 1 or GPIOE? How can I confirm the correct alternate function for PE_9? Should I adjust the prescaler or check the timer clock frequency? Could GPIO configuration be affecting the LED? Any debugging tips, such as checking timer flags or using an oscilloscope, to verify the signal?
4 replies