Canonical: https://toolipedia.app/microcontroller-timing-calculator

# Microcontroller Timing Calculator

Check UART baud rate error and divisor for a clock, work out PWM frequency, duty cycle and average voltage, and find timer prescaler and reload values.

Breadcrumbs: Toolipedia > Online calculators > Electronics and engineering calculators > Microcontroller Timing Calculator

## About Microcontroller Timing Calculator

A UART makes its baud rate by dividing the clock, so only some rates are exact. With a 16 MHz clock and 16 clocks per bit, 9600 baud needs a divisor of 104.17, rounded to 104, giving 9615.38 baud, an error of plus 0.16 percent; an AVR stores 103 in UBRR. The page lists the error for common rates at both oversampling settings, works out PWM frequency, duty compare value and average voltage from prescaler and counter size, and shows the timer ticks and reload values for every prescaler.

## How to use Microcontroller Timing Calculator
1. Choose UART, PWM or timer mode and enter the clock frequency in MHz.
2. Add the baud rate and oversampling, or the prescaler, counter size and duty cycle, or the period you want to time.
3. Read the divisor and error, the PWM frequency and compare value, or the table of prescalers, and keep the error within about 2 percent for a UART.

## Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.

## Also known as
- microcontroller timing calculator
- uart baud rate error calculator
- ubrr calculator
- pwm frequency duty cycle calculator
- timer prescaler reload calculator
- arduino timer calculator

## Frequently asked questions

### How much baud rate error is acceptable?

Two devices communicate reliably when the combined error stays under roughly 2 to 3 percent. Keep your side under 2 percent so the other device has room for its own error.

### Why does the compare value differ by one on my chip?

Chips count differently: some count from 0 to top, others clear on a match, and some treat 0 percent and 100 percent specially. The page gives the standard formula, so check your datasheet for the exact off-by-one rule.

### Which prescaler should I choose for a timer?

Use the smallest prescaler whose tick count still fits the timer size, because a smaller prescaler gives finer steps and less rounding error. The table marks which ones fit.

### Is Microcontroller Timing Calculator free?

Yes. Microcontroller Timing Calculator on Toolipedia is free to use, with no sign-up and no watermark.

### Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

### Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

### Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

## Related tools

More free tools that go well with Microcontroller Timing Calculator:
- [555 timer calculator](https://toolipedia.app/555-timer-calculator)
- [Arduino and ESP32 Pinout Viewer](https://toolipedia.app/arduino-esp32-pinout-viewer)
- [Solar Charge Controller and MPPT/PWM Sizing Calculator](https://toolipedia.app/solar-charge-controller-and-mppt-pwm-sizing)
- [LoRa Airtime and Data Rate Calculator](https://toolipedia.app/lora-airtime-and-data-rate-calculator)
- [Morse Code Practice and Timing Tool](https://toolipedia.app/morse-practice-generator)
