1
\$\begingroup\$

This question already has an answer here:

We are working with a modern microcontroller ATXMega32E5, from the ATMEL XMega family.

Our aim is to use the UART of the controller for effective communication, with the speed of about 9600 or 4800 baud rate. We tested the controller with the internal default 2Mhz clock frequency. UART is working well in both 9600 and 4800 baud rates.

As the controller is working fine, Is it really critical to use an external crystal for the system clock?

We just want to know, whether to use the internal calibrated RC oscillator or any external crystal. Please elaborate the explanation

\$\endgroup\$

marked as duplicate by Dave Tweed Aug 21 '16 at 1:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    \$\begingroup\$ internal RC are fine, but jitter and temperature response can eventually cause problems. Be safe, whack an 8Mhz ceramic resonater like the tiny Murata Ceralock series that I love putting with my ATmega328s, for the small package size and good specs, and under $1 each. \$\endgroup\$ – KyranF Oct 14 '14 at 5:48
3
\$\begingroup\$

The main advantage of external quartz crystals are their frequency stability over a wide range of temperatures. RC oscillators, on the other hand, tend to vary considerably over temperature.

A crystal, for example, may advertise a frequency stability of 50ppm. That's just 0.005% drift over the entire range of temperatures specified. Taking a quick look at the ATXMega32E5's datasheet shows the internal RC is only good for 0.5% and that's just at 25C. Go hotter or colder and your oscillator frequency will drift even more. To make matters worse, manufacturers make no promise which way the oscillator frequency will drift. It may be different from chip to chip. In the worst case scenario, the oscillator in one device will drift faster and the other will drift slower, causing possibly sporadic and difficult to trace communication corruptions.

Under "nice" conditions, you should have no problem successfully using UART communication with the internal RC oscillator. But if the devices will experience large temperature swings, it's best to switch to something with better accuracy, like a crystal.

\$\endgroup\$
  • 1
    \$\begingroup\$ Actually, the XMega series feature the - actually quite high precision - RC oscillator system with PLL system if required to achieve sufficient accuracy over 0 to 85 degree celcuis to achieve reliable UART operation. Don't forget either that a crystal is only that accurate when used exactly right at exactly the right temperature. Add double the pF on the load (easy to do without good math and/or proper tools) and you'll be up to 0.1% or worse. \$\endgroup\$ – Asmyldof Oct 14 '14 at 6:11
  • \$\begingroup\$ @Asmyldof, I don't agree with everything in your comment. The advertised accuracy of a crystal is typically stated for the entire operating temperature range (sometimes as much as -40 to +125). It doesn't have to be at "exactly the right temperature". The datasheet for the ATXMega32E5 shows a frequency range of 8.14MHz - 8.00MHz for the entire temperature range. Sure, that's probably fine for most UART applications, and it may be good for an RC oscillator, but it's orders of magnitude worse than a crystal. \$\endgroup\$ – Dan Laks Oct 14 '14 at 6:38
  • \$\begingroup\$ @Asmyldof I just want to know how reliable is the internal oscillator for overall working of the controller. We will be using I2C, UART, TIMER/COUNTER etc. Is it so critical when used in the final product. Will the internal oscillator stability degrade over the years? If so, Will it atleast work good for 5 years of time. \$\endgroup\$ – gzix Oct 14 '14 at 6:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.