Issue with second HRTIM PWM output (HRTIM1_CHC1 always stuck at 50% duty cycle)
Hello everyone,
I’m working on the STM32G474RE and trying to generate two independent PWM outputs using the HRTIM peripheral. To get started, I followed this tutorial: wiki.st.com/stm32mcu/wiki/Getting_started_with_HRTIM
For my first PWM output, I used:
-
Timer: HRTIM1
-
Channel: CHA1
-
Compare Unit: CMP1
This one works perfectly , the duty cycle changes correctly when I update the compare value.
The problem
When I tried to add a second PWM output, I followed the exact same steps as for the first one, except I used:
-
Channel: CHC1
-
Compare Unit: still CMP1 (as shown in the tutorial)
However, this second output (HRTIM1_CHC1) is always stuck at 50% duty cycle, no matter what compare value I write. Even if I set the compare value very low or very high, the output waveform stays at 0.5 duty cycle.
What I checked
-
The GPIO pin for CHC1 is correctly configured in alternate function mode.
-
The timer is enabled and running.
-
The compare register is being updated (I verified in the debugger).
-
The first channel (CHA1) continues to work normally.
-
No fault or dead‑time configuration is active.
My question
Is there something specific about CHC1 or about using the same compare unit (CMP1) on multiple channels that could cause this behavior? Do I need to use a different compare unit for each channel, or is there an additional configuration step required for CHC1?
Any guidance would be greatly appreciated. Thanks in advance!
