16.8.5 External Multipurpose Crystal Oscillator (XOSC) Control

Name: XOSC
Offset: 0x10
Reset: 0x0080
Property: Write-Protected

Bit 15141312111098 
 STARTUP[3:0]AMPGCGAIN[2:0] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 
Bit 76543210 
 ONDEMANDRUNSTDBY   XTALENENABLE  
Access R/WR/WR/WR/W 
Reset 1000 

Bits 15:12 – STARTUP[3:0] Start-Up Time

These bits select start-up time for the oscillator according to the table below.

The OSCULP32K oscillator is used to clock the start-up counter.

STARTUP[3:0] Number of OSCULP32K Clock CyclesNumber of XOSC Clock CyclesApproximate Equivalent Time(1)(2)(3)
0x01331 μs
0x12361 μs
0x243122 μs
0x383244 μs
0x4163488 μs
0x5323977 μs
0x66431953 μs
0x712833906 μs
0x825637813 μs
0x9512315625 μs
0xA1024331250 μs
0xB2048362500 μs
0xC40963125000 μs
0xD81923250000 μs
0xE163843500000 μs
0xF3276831000000 μs
Note:
  1. Number of cycles for the start-up counter
  2. Number of cycles for the synchronization delay, before PCLKSR.XOSCRDY is set.
  3. Actual start-up time is n OSCULP32K cycles + 3 XOSC cycles, but given the time neglects the three XOSC cycles.

Bit 11 – AMPGC Automatic Amplitude Gain Control

Note: The configuration of the oscillator gain is mandatory even if AMPGC feature is enabled at startup.
ValueDescription
0The automatic amplitude gain control is disabled
1The automatic amplitude gain control is enabled. Amplitude gain will be automatically adjusted during Crystal Oscillator operation.

Bits 10:8 – GAIN[2:0] Oscillator Gain

These bits select the gain for the oscillator. The listed maximum frequencies are recommendations, and might vary based on capacitive load and crystal characteristics. These bits must be properly configured even when the Automatic Amplitude Gain Control is active.

GAIN[2:0]Recommended Max Frequency
0x02 MHz
0x14 MHz
0x28 MHz
0x316 MHz
0x430 MHz
0x5-0x7Reserved

Bit 7 – ONDEMAND On Demand Control

The On Demand operation mode allows an oscillator to be enabled or disabled, depending on peripheral clock requests.

In On Demand operation mode (i.e., if the XOSC.ONDEMAND bit has been previously written to one), the oscillator will be running only when requested by a peripheral. If there is no peripheral requesting the oscillator s clock source, the oscillator will be in a disabled state.

If On Demand is disabled, the oscillator will always be running when enabled.

In Standby Sleep mode, the On Demand operation is still active if the XOSC.RUNSTDBY bit is one. If XOSC.RUNSTDBY is zero, the oscillator is disabled.

ValueDescription
0The oscillator is always on, if enabled
1The oscillator is enabled when a peripheral is requesting the oscillator to be used as a clock source. The oscillator is disabled if no peripheral is requesting the clock source.

Bit 6 – RUNSTDBY Run in Standby

This bit controls how the XOSC behaves during Standby Sleep mode:

ValueDescription
0The oscillator is disabled in Standby Sleep mode.
1The oscillator is not stopped in Standby Sleep mode. If XOSC.ONDEMAND is one, the clock source will be running when a peripheral is requesting the clock. If XOSC.ONDEMAND is zero, the clock source will always be running in Standby Sleep mode.

Bit 2 – XTALEN Crystal Oscillator Enable

This bit controls the connections between the I/O pads and the external clock or crystal oscillator:

ValueDescription
0External clock connected on XIN. XOUT can be used as general purpose I/O.
1Crystal connected to XIN/XOUT

Bit 1 – ENABLE Oscillator Enable

ValueDescription
0The oscillator is disabled
1The oscillator is enabled