Skip to content
ENExplore Calculators

Microcontroller Clock Timing Calculator

Work out microcontroller clock timing instantly with clear inputs, formula shown and shareable results.

About Microcontroller Clock Timing Calculator

Execution time is instructions times cycles per instruction times the clock period. At 16 MHz each cycle is 62.5 ns, so a 250-instruction single-cycle routine takes 15.6 microseconds — the calculation that decides whether an interrupt handler fits inside its deadline.

Formula

Timing

cycle period = 1/f; execution time = instructions x CPI x period; peripheral clock = f / prescaler

Worked example

With the default values below, Microcontroller Clock Timing Calculator returns Routine execution time of 15.63. Change any input above and every figure here is recalculated in your browser.

Inputs used

Clock frequency
16 MHz
Cycles per instruction
1 cycles
Instructions in the routine
250 instructions
Peripheral prescaler
8 x

Results

Routine execution time
15.63 µs
Clock period
62.50 ns
Instruction throughput
16.00 MIPS
Peripheral clock after prescaling
2,000.00 kHz

Step by step

  1. 1Values used
  2. 2Timing
  3. 3Routine execution time= 15.63 µs
  4. 4Clock period= 62.50 ns
  5. 5Instruction throughput= 16.00 MIPS
  6. 6Peripheral clock after prescaling= 2,000.00 kHz

Assumptions and limits

  • The result is derived only from the 4 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 2 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 is cycles per instruction not always one?

Branches, memory access, multiplies and divides take several cycles. Flash wait states at high clock speeds add more, so effective CPI is usually above one.

What is the prescaler for?

It divides the system clock down so timers and peripherals can reach long intervals or match a required baud or sample rate.

Microcontroller Clock Timing Calculator | Calcrivo