STM32 Timer Calculator

Just enter the duration — automatically calculate PSC, ARR and CCR values. Clock chain analysis, error rate and ready-to-use C code generation.

STM32 Timer Calculator

Enter only these

Quick start

What does this tool do?

Using the timer (counter) peripheral on STM32 microcontrollers requires correctly calculating PSC (Prescaler) and ARR (Auto-Reload Register) values. These values form the foundation of dozens of applications — PWM generation, servo control, ultrasonic distance measurement, motor driver signals, or interrupts triggered at precise intervals.

The tool automatically calculates the clock chain (SYSCLK → AHB → APB → Timer), applies the rule that the timer receives 2× the clock when APB prescaler > 1, and finds the optimal PSC/ARR combination with the lowest error rate. The same formulas apply to STM32F1, F2, F3, F4 and L4 series.

Core formulas

f_timer = f_APB_eff / (PSC + 1)f_overflow = f_timer / (ARR + 1)Duty (%) = CCR / (ARR + 1) × 100If APB div > 1: f_APB_eff = f_APB × 2