The Good and the Bad of MCU Internal Oscillators

Eduardo Corpeño | 19/02 |
Eduardo Corpeño 992 19/02 2020-02-19 16:40:00

Low-cost microcontroller units often come with an internal RC oscillator for you to use instead of an external ceramic or quartz crystal oscillator . However, you are expected to fine-tune this oscillator.

Chances are, your favorite MCU has an internal RC oscillator. There are numerous microcontroller families from all major manufacturers that include this module, including those from Texas Instruments, STMicroelectronics, and Microchip. There are also accompanying application notes online from virtually all manufacturers on how to calibrate the internal oscillator of their MCUs.

Using an internal oscillator has a number of benefits, and you may not really need an external crystal or ceramic oscillator. However, there are some critical applications that need very accurate timing like serial ports, timers, and USB interfaces. Even for most of these applications, an internal oscillator will likely live up to strict timing requirements if you fine-tune it.

Read on to learn about internal oscillators and an easy calibration procedure to get the best performance of your clock signals.

 

A GPIO application of the 9S08SH8 microcontroller, by NXP. Notice the absence of an external oscillator.

 

For more on MCU oscillators, you should read the article Choosing the Right Oscillator for Your Microcontroller by Robert Keim.

 

Benefits of Internal Oscillators

Internal oscillators are everywhere for a reason. Here are some of their benefits:

1. They require fewer external components. An external oscillator circuit or its feedback circuitry are no longer necessary. This has a positive impact on budgets, PCB area, and the overall size of your finished gadget.

2. They leave one or two pins available for I/O. Most MCUs with a low pin-count assign several functions to each pin for the user to choose its purpose. So if you choose to use the internal oscillator in your MCU, you’ll free up the clock input pin, or the two pins where a crystal or ceramic resonator would go.

 

DIP28 pinout of the ATmega328 MCU, the core of the Arduino Uno. Pins 9 and 10 are intended for a crystal resonator , and alternatively for GPIO pins PB6 and PB7, respectively. Image used courtesy of Mediaquark [CC BY-SA 4.0],

 

3. They keep high frequencies inside the IC. Although some microcontrollers employ a crystal or ceramic resonator at low frequencies under 100kHz, it’s much more common to use an external oscillator at or above 10MHz. This high clock frequency is almost always used exclusively by the CPU, and prescaled down inside the MCU for its peripheral modules (ADC, UART, SPI, USB, GPIO, etc.)

Having high frequencies outside the chip might be a problem in some PCBs, so keeping the high frequencies inside is usually a good idea.

 

The Drawbacks of Internal Oscillators

Internal oscillators are made of resistors and capacitors inside the integrated circuit. Producing these passive devices inside chips has its limitations, especially when it comes to accuracy and repeatability. This means that two identical microcontroller chips will likely show a meaningful difference in their internal oscillator frequencies, just like two identical guitars will play at slightly different pitches after being tuned at two different dinner parties.

For more on RC oscillators, you may want to read the article I wrote on Exactly How Schmitt Trigger Oscillators Work.

Aside from getting exactly the intended values of resistance and capacitance inside a chip (accuracy), and getting exactly the same values for all chips in a lot (repeatability), there’s the problem of temperature. It turns out that capacitance and resistance both experience slight changes with temperature, and this is particularly significant for internal oscillators. So, you don’t only have to worry about different chips working at slightly different frequencies, but also about their frequency changing with temperature.

If you don’t expect ambient temperature to change dramatically, you shouldn’t worry about your internal oscillator once you’ve calibrated it. However, if you expect significant temperature variations and your system is highly sensitive to frequency changes (like a real-time clock, or a high-speed communication system), then an external oscillator is a better option.

 

If RC oscillators are so bad, why don’t manufacturers embed a crystal or

ceramic oscillator inside the MCU?

The IC manufacturing process is very limited in the list of materials that can be miniaturized, and as you may guess, quartz and ceramic are not on that list. So, although a hybrid approach is conceivable, it’s not practical. 

RC oscillators aren’t really that bad. In fact, user guides for modern MCUs report internal oscillator frequency accuracies typically under ±10%, which can be fine-tuned to under ±0.5%. So the bottom line is that you will get away with a lot of applications if you don’t even bother fine-tuning the internal oscillator, and with most applications if you do.

 

Conclusion

Even though crystal and ceramic oscillators are highly reliable because of their accuracy and stability, RC oscillators are pretty good for many modest applications, and offer important benefits.

On the other hand, RC oscillators aren’t perfect, so you must always assess your application to be able to tell when to use the internal oscillator, and when you’re better off with a crystal or ceramic oscillator.

Tags -
Share this post

Popular Post

Blog

Introduction to Nexperia Automotive-Grade ICs

Electronics in the automotive industry require accuracy, durability and complete reliability. All systems, including the engine control and modern driver assist, are based on parts that have to endure both high temperature and electrical interference, as well as extended durability of operation.

Blog

ASIC vs FPGA Comparison: Performance, Cost, and Design Differences Explained

This article compares Application-Specific Integrated Circuits (ASICs) and Field-Programmable Gate Arrays (FPGAs), two technologies used for creating custom digital circuits.

Solution

The Rise of Automotive-Grade SiC/GaN Power Devices in Electric Vehicles

The automotive fast recovery Silicon Carbide (SiC) and Gallium Nitride (GaN) power devices emerge as game-changing technologies.

Blog

How to Safely Discharge an AC Capacitor

AC capacitor discharge refers to the process in which a capacitor releases its stored electrical energy in an alternating current (AC) circuit.

Blog

Signs of a Bad Camshaft Position Sensor and How to Test it?

A car has a variety of electrical components, one of which is called a camshaft position sensor (CMP). This section will discuss this component, the signs that indicate a problematic camshaft position sensor, and the procedures for doing so.

Blog

Symptoms of a Bad Speed Sensor and How to Test It?

Speed sensors are utilized to measure the speed at which devices are spinning. Many vehicles, including automobiles, aerospace vehicles, off-highway and construction equipment, railway vehicles, and military vehicles, require speed sensors.

Blog

Current Divider: definition, applications & formula

A current divider is an electrical circuit configuration used to split or divide an input current into multiple branches or paths.

Solution

74LS04 Hex Inverter Datasheet(PDF) and Pinout

This article will explain some detailed information about 74LS04 Hex Inverter, including its datasheet, pinout, features and specifications.

Recommend Products

AT49LV002T-70PI

Microchip Technology

IC FLASH 2M PARALLEL 32DIP

AT17LV002A-10JI

Microchip Technology

FPGA - Configuration Memory CONFIG SER EEPROM-2M ALTERA PINOUT-10MHZ

BZV49-C62,115

Nexperia USA Inc.

DIODE ZENER 62V 1W SOT89

MT29F128G08CECABH1-12:A

Micron Technology Inc.

MLC NAND Flash Parallel/Serial 3.3V 128Gbit 16G x 8bit 100-Pin VBGA

M29W640GH7ANB6E

Micron Technology Inc.

N25Q128A13ESE40E

Micron Technology Inc.

IC FLASH 128M SPI 108MHZ 8SOP2

AT45D161-RC

Microchip Technology

MT29F2G08ABDHC:D TR

Micron Technology Inc.