Internal Clock Sources

There are five internal clock sources (including the internal PLL), ranging from an ultra-low power 32kHz RC oscillator to a 32MHz factory-calibrated ring oscillator with auto-calibration features. All but one can be used for the main system clock.

Any number of the internal sources can be enabled at any given time, even if none are used for the main system clock. Also, some clock sources might even be used for multiple purposes, such as the 32kHz RC oscillator that can be used as a main system clock and as a clock source for the Real-time Counter module at the same time.

Some of the internal clock sources can be used as a reference to the internal PLL in order to generate even higher frequencies. The PLL is covered in the High-frequency PLL Option section.

Ultra-low Power 32kHz RC Oscillator

The Ultra-low Power 32kHz internal RC oscillator (ULP32K) is mainly used for system purposes, such as startup delays, the Watchdog Timer, and various internal timings. It can be used for the Real-time Clock module, but is not available as a system clock source. With a frequency accuracy of 30%, it is not intended as such either.

The ULP oscillator can be used as a source for the Real-time Counter module. Refer to the application note “AVR®1314: Using the XMEGA Real-time Counter” for more details.

The ULP oscillator is automatically enabled by hardware when it is needed.

Calibrated 32kHz RC Oscillator

The 32.768kHz internal RC oscillator (RC32K) is factory-calibrated to 32kHz with an accuracy of 1% at 3V and 25°C. The calibration value is stored in the calibration row and is automatically loaded into the oscillator’s calibration register (RC32KCAL) on reset. This value is read and write accessible for the user, but the oscillator should not be tuned outside recommended limits. Refer to the electrical characteristics in the device datasheet for details.

The RC32K oscillator can be used as a system clock source directly and also as a source for the Real-time Counter module (actually the RC32K divided down to 1.024kHz). Refer to the application note “AVR1314: Using the XMEGA Real-time Counter” for more details.

The RC32K oscillator cannot be used as a source for the internal PLL.

Apart from being a system clock source alternative, the RC32K can also be used as a reference for the auto-calibration feature of the 2MHz and 32MHz internal oscillators. The two oscillators and the auto-calibration feature are covered in later sections.

The Internal 32kHz RC Oscillator Enable bit (RC32KEN) in the Oscillator Control register (OSC.CTRL) controls this oscillator, while the Internal 32kHz RC Oscillator Ready bit (RC32KRDY) in the Oscillator Status register (OSC.STATUS) can be polled to check if it is stable and ready to be used as a system clock source.

Calibrated 2MHz RC Oscillator

The 2MHz internal RC oscillator (RC2M) is factory-calibrated to 2MHz with an accuracy of 1% at 3V and 25°C. The calibration value is stored in the calibration row and is automatically loaded into the oscillator’s internal calibration register on reset. The oscillator can be further tuned and calibrated using the auto-calibration feature covered in a later section.

The RC2M oscillator can be used as a system clock source directly or through the internal PLL to generate even higher system frequencies. Note that when using the PLL, the user is responsible for not exceeding recommended frequency limits for the CPU and peripherals.

The Internal 2MHz RC Oscillator Enable bit (RC2MEN) in the Oscillator Control register (OSC.CTRL) controls this oscillator, while the Internal 2MHz RC Oscillator Ready bit (RC2MRDY) in the Oscillator Status register (OSC.STATUS) can be polled to check if it is stable and ready to be used as a system clock source.

Calibrated 32MHz Ring Oscillator

The 32MHz internal ring oscillator (R32M) is factory-calibrated to 32MHz with an accuracy of 1% at 3V and 25°C. The calibration value is stored in the calibration row and is automatically loaded into the oscillator’s internal calibration register on reset. The oscillator can be further tuned and calibrated using the auto-calibration feature, which is covered in the Automatic Runtime Calibration of Internal Oscillators section.

The R32M oscillator can be used as a system clock source directly or through the internal PLL to generate even higher system frequencies. Note that when using the PLL, the user is responsible for not exceeding recommended frequency limits for the CPU and peripherals.

The Internal 32MHz Ring Oscillator Enable bit (R32MEN) in the Oscillator Control register (OSC.CTRL) controls this oscillator, while the Internal 32MHz Ring Oscillator Ready bit (R32MRDY) in the Oscillator Status register (OSC.STATUS) can be polled to check if it is stable and ready to be used as a system clock source.