Electronic – Difference between internal and external oscillator for a microcontroller

frequencymicrocontrolleroscillatortimer

I am a beginner with respect to microcontrollers, so I just want to ask is there two option for choosing the frequency of the microcontroller: to be internal or external?

If there is internal frequency available in the controller, then we don't need to use external crystal oscillator?

Best Answer

It depends on what you want to use the processor for, the manufacturer, etc. RC internal oscillators are "only" good for 1-2% accuracy, there are some processors that have tuning adjustment registers that allow you to shift the frequency, so with the right software/calibration, etc. you can get better results.

For (asynchronous) serial port type communications, the RC inaccuracy can become critical at high baud speeds (generally 230kbps and above, depending on processor and baud rate clock flexibility)

With RC oscillators you typically get 1 or 2 frequencies unless the MCU offers PLL capabilities in which case there can be a wide range. This can be used to advantage to dynamically scale the clock speed for battery powered situations where you can't go to 'sleep' due to complicated monitoring situations, but don't have to be running flat-out.

A crystal can get you any frequency you would want within the MCU operating limits, however you need to verify that the loading is correct so that the oscillator starts up correctly and is accurate and stable over time and temperature.

The RC internal oscillator is generally guaranteed to work by the manufacturer with no hardware design issues.