2025-04-15 12:31 AM
Hi everyone
I am new to STM32CubeIDE and I'm trying to generate PWM pulses with a fixed duty cycle and frequency using the up-down counting mode. However, I couldn't find an option in the Timer configuration to specify the output action based on whether the counter is counting up or down. The available options seem to work only for up-count or down-count modes, but not for up-down mode. I’ve attached an image showing the current configuration. Could you please help me resolve this issue?
Thankyou in advance
2025-04-15 1:24 AM
Hello,
what microcontroller are you using?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-04-15 1:39 AM
NUCLEO-G474RE
2025-04-15 2:00 AM
I have configured TIM2 to generate PWM on LED pin with frequency 1 Hz and 50%duty cycle. In CubeMX it looks like this (timer clock is 16 MHz in my MCU) where I chose Center aligned mode 2 and other setting are the same as for up or down counter mode:
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-04-15 2:06 AM
Thank you for your response
I want to generate PWM pulses in up down count mode used to generate a triangular carrier.