2025-03-25 1:30 PM - last edited on 2025-03-25 1:46 PM by Tesla DeLorean
Hi All,
I have a project that is using the STM32H562. I am having an issue using tim13 and tim14 to generate PWM outputs going to LEDs. The project uses timers tim2, tim3, tim4, tim13, and tim14 for a range of different PWM peripherals. For all of the timer instances that aren't tim13 and tim14, the PWM configures and works as expected, but I am unable to get any PWM output signal on the channels controlled by tim13 and tim14. Neither the autogenerated INIT functions or my application code to update the pulse width value return any errors from the HAL functions, and I can see the value of the registers being updated with the new pulse value, but there is no output on those pins. I have verified to some extent the hardware, because I am able to toggle those LED pins by configuring them as standard GPIO outputs and driving them high to see the LEDs illuminate. Any suggestions or information would be greatly appreciated! I can provide more information upon request. Thanks!
2025-03-25 1:45 PM - edited 2025-03-25 1:47 PM
Would suggest showing code, especially pin and TIM initialization code.
Ideally minimal/single function rather than CUBE spread it everywhere and obfuscated. Perhaps config TIM in lower frequency toggle mode rather than PWM
Enumerate the pins in use.
Perhaps inspect signals with a scope rather than LEDs / EYEs
Dump RCC, GPIO and TIM registers related to implementation