Skip to content
ENExplore Calculators

Timer Prescaler Value Calculator

Work out timer prescaler value instantly with clear inputs, formula shown and shareable results.

About Timer Prescaler Value Calculator

The prescaler must be large enough that the tick count fits in the timer, so the minimum is clock times period divided by 2^bits. Choosing the next available power of two and rounding the reload value gives the achievable period, and the rounding error is what shows up as timing drift.

Formula

Prescaler

ticks = f x period; prescaler >= ticks / 2^bits; reload = round(ticks / prescaler)

Worked example

With the default values below, Timer Prescaler Value Calculator returns Prescaler required of 16.00. Change any input above and every figure here is recalculated in your browser.

Inputs used

Timer clock
48 MHz
Required period
20 ms
Timer width
16 bits

Results

Prescaler required
16.00 x
Reload / compare value
60,000 counts
Achievable period
20.00000 ms
Timing error
0.00000% %

Step by step

  1. 1Values used
  2. 2Prescaler
  3. 3Prescaler required= 16.00 x
  4. 4Reload / compare value= 60,000 counts
  5. 5Achievable period= 20.00000 ms
  6. 6Timing error= 0.00000 %

Assumptions and limits

  • The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax or fees or charges into account.
  • Figures are rounded for display to 5 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Why use the smallest workable prescaler?

It gives the finest resolution, so the rounded reload value lands closer to the exact period and the timing error is smaller.

How do I get an exact period?

Choose a clock frequency that divides evenly — this is why 32.768 kHz crystals and 12/24/48 MHz clocks are so common in timing-critical designs.

Timer Prescaler Value Calculator | Calcrivo