Timer Prescaler Calculator

Find the best prescaler (PSC) and auto-reload (ARR) values for your MCU timer to achieve a target frequency with minimal error.

Prescaler (PSC) Period (ARR) (ARR) Actual Frequency Error

Timer Frequency Formula

ftimer = fclk / (PSC + 1) / (ARR + 1)
Where:
fclk = Timer peripheral clock frequency
PSC = Prescaler register value (0–max)
ARR = Auto-reload register value (0–max)

Common Presets

How Timer Prescaling Works

An MCU timer counts clock pulses. The prescaler divides the input clock before it reaches the counter, and the auto-reload (ARR) value determines when the counter overflows. Together, PSC and ARR control the timer's output frequency: f_timer = f_clk / (PSC+1) / (ARR+1). Choosing values that produce zero error means the timer hits the target frequency exactly.

Tips for Choosing Values

Prefer smaller prescaler values when you need finer frequency resolution. For PWM, a larger ARR gives more duty-cycle steps. When exact frequency isn't possible, check whether the error percentage is acceptable for your application — under 0.1% is usually fine for most use cases. Some MCUs (e.g. STM32) multiply the APB bus clock before it reaches the timer, so verify f_clk in your reference manual.

Related Tools