SPRUJF2A March 2026 – March 2026 AM13E23019
The external crystal oscillator (XTAL) can be used with standard crystals and resonators in the 10-25MHz range to generate a stable reference clock for the system. The XTAL can also operate in single-ended mode, with an external clock in the 4-48MHz range connected to the X1 pin. The XTAL can be used to clock the primary device clock tree (MCLK) directly, or it can be used as a precision reference to the on-chip PLL where higher frequencies can be generated.
To use the XTAL, a crystal or resonator must be populated between the X1 and X2 pins. Loading capacitors must be placed on both pins to circuit ground (VSS). The crystal load capacitors must be sized according to the specifications of the crystal being used. The IOMUX must be configured to enable XTAL functionality on the X1 and X2 pins.
A programmable XTAL startup time is provided with 64μs resolution. Program an appropriate startup time based on the desired crystal or resonator specifications into the XTALTIME field in the HFCLKCLKCFG register in SYSCTL before starting the XTAL.
Once configured properly, the XTAL is started by clearing the OSCOFF bit in the XTALCR register in SYSCTL. When the oscillator has started successfully, the HFCLK startup monitor will assert the HFCLKGOOD bit in the CLKSTATUS register in SYSCTL.
After clearing XTALCR.OSCOFF to enable the XTAL, application software must verify that either an HFCLKGOOD indication or an HFCLKOFF (off/dead) indication in the CLKSTATUS register was asserted by hardware. When disabling the XTAL, the XTAL must not be re-enabled again until the HFCLKOFF bit in the CLKSTATUS register is set by hardware.
To use XTAL as the PLL reference after receiving an HFCLKGOOD status, set the SYSPLLREF bit in the SYSPLLCFG0 register in SYSCTL. If XTAL is selected as a reference for the SYSPLL and the SYSPLL is enabled, then the SYSPLL must be disabled and the SYSPLLOFF bit in the CLKSTATUS register must be set before the XTAL can be disabled.
To use the XTAL directly as the MCLK source after receiving an HFCLKGOOD status, first set the HSCLKSEL bit in the HSCLKCFG register to select HFCLK as the high-speed clock source (rather than the system PLL output). Then, set the USEHSCLK bit in the MCLKCFG register to select the high-speed clock source as the MCLK source. Once USEHSCLK is set, HSCLKCFG must not change and the XTAL must not be disabled until the MCLK source is switched back to SYSOSC by clearing USEHSCLK and verifying that the HSCLKMUX bit in CLKSTATUS is cleared by hardware.
External clock sources use the X1/X2 pins, which can either be used as an oscillator or as GPIOs. X1 is assigned to GPIO80 and X2 is assigned to GPIO81. These mode settings can be controlled through the XTALCR register. After power-up, the X1 and X2 pin functionality can be enabled by following the procedure in Using an External Crystal or Resonator.
Three types of external clock sources are supported:
To ensure correct switching between single-ended and double-ended modes, the XTAL has to be powered down in between. That is, XTALCR.SE = 0 and XTALCR.OSCOFF = 1 has to be used as a transitory configuration state.
| XTALCR.OSCOFF | XTALCR.SE | Operating Mode | X1 using GPIO80? | X2 using GPIO81? |
|---|---|---|---|---|
| 0 | 0 | Crystal Mode: Quartz crystal connected to X1/X2 | No | No |
| 0 | 1 | Single-Ended Mode: External clock on X1 | No | Yes |
| 1 | 0 | Oscillator off | Yes | Yes |
| 1 | 1 | Single-Ended Mode: External clock on X1 | No | Yes |
The X1 and X2 pins double as GPIO80 and GPIO81 respectively. At power-up, these pins are in GPIO mode and the on-chip crystal oscillator is powered off. The following procedure can be used to switch the pins to X1 and X2 mode and enable the oscillator:
The X1 and X2 pins double as GPIO80 and GPIO81 respectively. At power-up, these pins are in GPIO mode and the on-chip crystal oscillator is powered off. The following procedure can be used to switch the pins to X1 and X2 mode and enable the oscillator: