28.8.6 External Multipurpose Crystal Oscillator Control

Name: XOSCCTRL
Offset: 0x14 + n*0x04 [n=0..1]
Reset: 0x00000080
Property: PAC Write-Protection

Bit 3130292827262524 
     CFDPRESC[3:0] 
Access R/WR/WR/WR/W 
Reset 0000 
Bit 2322212019181716 
 STARTUP[3:0]  SWBENCFDEN 
Access R/WR/WR/WR/WR/WR/W 
Reset 000000 
Bit 15141312111098 
 ENALCIMULT[3:0]IPTAT[1:0]LOWBUFGAIN 
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 27:24 – CFDPRESC[3:0] Clock Failure Detector Prescaler

These bits select the prescaler for the clock failure detector.

The DFLL48 oscillator is used to clock the CFD prescaler.

The CFD safe clock frequency is the DFLL48 frequency divided by 2^CFDPRESC.

Bits 23:20 – STARTUP[3:0] Start-Up Time

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

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

Table 28-6. Start-UpTime for External Multipurpose Crystal Oscillator
STARTUP[3:0]Number of OSCULP32K Clock CyclesNumber of XOSC Clock CyclesApproximate Equivalent Time(
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

Bit 17 – SWBEN Xosc Clock Switch Enable

This bit controls the XOSCn output clock switch back to the external clock or crystal oscillator in case of clock recovery :

0: The clock switch back is disabled.

1: The clock switch back is enabled. This bit is reset once the XOSCn output clock is switched back to the external clock or crystal oscillator.

Bit 16 – CFDEN Clock Failure Detector Enable

This bit controls the XOSCn clock failure detector :

0: the Clock Failure Detector is disabled.

1: the Clock Failure Detector is enabled.

Bit 15 – ENALC Automatic Loop Control Enable

This bit controls the XOSCn automatic loop control :

0: the automatic loop control is disabled.

1: the automatic loop control is enabled. Oscillator's amplitude will be automatically adjusted during Crystal Oscillator operation.

Bits 10:9 – IPTAT[1:0] Oscillator Current Reference

These bits select the current reference for the oscillator XOSCn, given in table below.

Table 28-7. External Multipurpose Crystal Oscillator Current Settings
Frequency RangeCurrent Setting
IMULT[3:0]IPTAT[1:0]
>24MHz to 48MHz63
>16MHz to 24MHz53
>8MHz to 16MHz43
8MHz32

For relatively small CLOAD in a frequency range, the setting for the lower frequency range can be used to preserve current consumption.

Bit 8 – LOWBUFGAIN Low Buffer Gain Enable

0: The low buffer gain of oscillator XOSCn is disabled.

1: The low buffer gain of oscillator XOSCn is enabled.

When XOSCCTRLn.ENALC=0 this bit has no effect.

When XOSCCTRLn.ENALC=1, this bit is used to adjust the oscillator's amplitude in automatic loop control.

The default value of LOWBUFGAIN=0 should be used to allow operating with a low amplitude oscillator. Use this setting except to solve stability issues.

Setting LOWBUFGAIN=1 will increase the oscillator's amplitude by a factor of approximately 2. Use this setting to solve stability issues.

Bit 7 – ONDEMAND On Demand Control

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

If On Demand is set, the oscillator will be running only when requested by a peripheral and enabled (XOSCCTRLn. ENABLE=1). If there is no peripheral requesting the oscillator’s clock source, the oscillator will be in a disabled state.

If On Demand is cleared, the oscillator will always be running when enabled (XOSCCTRLn.ENABLE=1). In standby sleep mode, the On Demand operation is still active.

0: The oscillator is always on.

1: The oscillator is running when a peripheral is requesting the oscillator to be used as a clock source. The oscillator is not running if no peripheral is requesting the clock source.

Bit 6 – RUNSTDBY Run in Standby

This bit controls how the XOSCn behaves during standby sleep mode:

0: The XOSCn is not running in standby sleep mode if no peripheral requests the clock.

1: The XOSCn is running in standby sleep mode. If ONDEMAND is one, the XOSCn will be running when a peripheral is requesting the clock. If 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 XOSCn:

0: External clock connected on XIN. XOUT can be used as general-purpose I/O.

1: Crystal connected to XIN/XOUT.

Bit 1 – ENABLE Oscillator Enable

0: The oscillator XOSCn is disabled.

1: The oscillator XOSCn is enabled.