ATMega328 RC vs quartz oscillator comparison

Kenneth compares the RC oscillator found on the ATMeg328 against an external quartz crystal. As expected there is a huge difference in precision and stability between the two.

This really demonstrates how both oscillators, but particularly the internal one, are very sensitive to temperature changes around the microcontroller.  This is why my counter’s oscillator is contained in a small oven, such that it’s held at a specific elevated temperature and doesn’t change temperature along with the room.

Join the Conversation


  1. The RC is totally useable for many many applications, so the initial “why we don’t use it” seems rather silly. UARTs aren’t really that time sensitive. Even USB devices can handle use less than ideal RCs in place of XTALs (see MCP2200 datasheet). There are many applications where jitter, phase noise and frequency stability are important, but simple UART isn’t it. I would guess that the XTAL is on Arudunio for long term time stability for people who want to build clocks and the like.

    1. USB has a sync byte at the beginning of each frame though. This is used to calibrate internal rc oscillators for each frame. Since USB has no clock pin, timing is very crucial for even half speed USB, not to mention the much faster speeds. Sometimes it’s just easier to use a crystal but with care an rc will do.

  2. I agree the RC oscillator is often very useful, especially for less time critical applications where the processor needs to run slower – thereby greatly reducing power consumption.

  3. The problem with the ATmega AVR chips is that the factory calibration of the RC oscillator is usually pretty bad. It varies between batches. Therefore baud-rates are too far off to have an UART work reliably out of the box. It needs to be calibrated in code using the OSCCAL register. The first larger batch of chips I bought worked just fine with factory calibration + UART, the next batch simply didn’t. The last ATmega I had in my fingers ran at 8.33MHz instead of 8.00MHz.

    1. Well I have used a lot of AVRs and never had one that didn’t do any baud-rate I desired with no bit errors. Even with a perfect clock there are errors due to divide by N.

  4. Hello,
    I’m new in microcontrollers and was wondering if it is possible to use any kind of Atmega wihout external oscellator? For example just connecting battery and LED. Is it possible? Some links please.
    Thank you.

  5. Haha, so everything is about Fuses configuration. That’s a new topic for me to google and kill one or another chip. :D
    Thank you Robert, I’ll study your link.

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.