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
- 1Values used
- 2Prescaler
- 3Prescaler required= 16.00 x
- 4Reload / compare value= 60,000 counts
- 5Achievable period= 20.00000 ms
- 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.
Related Calculators
- Acceleration Profile (Trapezoidal) Calculator
- ADC Sample Time Calculator
- AGV Fleet Size Calculator
- Analogue Sensor Scaling Calculator
- BLE Range Estimate Calculator
- Cabinet Heat Load Calculator
- Camera Field Of View For Inspection Calculator
- CAN Bus Bit Timing Calculator
- Charging Dock Cycle Time Calculator
- Coin Cell Battery Life Calculator
You might also need
- Contactor Sizing CalculatorAlso in Robotics, Automation & Embedded
- Deadband Setting CalculatorAlso in Robotics, Automation & Embedded
- Encoder Resolution CalculatorAlso in Robotics, Automation & Embedded
- Interrupt Latency CalculatorAlso in Robotics, Automation & Embedded
- Microstepping Resolution CalculatorAlso in Robotics, Automation & Embedded
- Overshoot Percentage CalculatorAlso in Robotics, Automation & Embedded
