STM32G4 PWM Calculator
Quickly determine PSC, ARR, and CCR values for STM32G4 timers and produce accurate PWM signals without manual calculations. Just choose your timer, enter the APB clocks, desired PWM frequency, and duty cycle — the calculator provides optimized values along with a ready-to-use configuration for STM32CubeIDE or CubeMX.
This tool is tailored for the STM32G4 series. Keep in mind that timer availability, APB bus assignments, and clock limits may differ for other STM32 families.
Configuration
Register values
PSC
—
ARR
—
CCR / Pulse
—
Timer clock
—
Actual freq
—
Freq error
—
DC resolution
—
Timer details
Formulas
Timer clk = APB × multiplier
Maximise ARR → best resolution
PSC = ⌊Tclk / (F × (ARR+1))⌋ − 1Maximise ARR → best resolution
CCR = round(ARR × Duty / 100)F_actual = Tclk / ((PSC+1)×(ARR+1))
STM32CubeIDE / HAL snippet
Explore More Tools
Return to the Tools Hub to access all STM32, ESP32, LCD, and other embedded development utilities.
Go to Tools Hub