19.7.6 External Multipurpose Crystal Oscillator Control A

Table 19-10. Register Bit Attribute Legend
SymbolDescriptionSymbolDescriptionSymbolDescription
RReadable bitHCCleared by Hardware(Grey cell)Unimplemented
WWritable bitHSSet by HardwareXBit is unknown at Reset
KWrite to clearSSoftware settable bit
Name: XOSCCTRLA
Offset: 0x14
Reset: 0x00000D00
Property: RW

Bit 3130292827262524 
 WRTLOCK     USBHSDIV[1:0] 
Access RWRWRW 
Reset 000 
Bit 2322212019181716 
     CFDPRESC[3:0] 
Access RWRWRWRW 
Reset 0000 
Bit 15141312111098 
     STARTUP[3:0] 
Access RWRWRWRW 
Reset 1101 
Bit 76543210 
 ONDEMAND SWBENCFDENXTALENAGCENABLE  
Access RWRWRWRWRWRW 
Reset 000000 

Bit 31 – WRTLOCK Write Lock for CTRLA register

Note: Once the WRTLOCK bit is set, it can only be cleared by a reset.
ValueDescription
0The XOSCCTRLA register can be modified by a system write.
1The XOSCCTRLA (except XOSCCTRLA.SWBEN) register is write protected.

Bits 25:24 – USBHSDIV[1:0] USBHS Referrence Clock Division

ValueNameDescription
0DISUSBHS PLL reference XOSC clock is disabled
1DIV1USBHS PLL reference XOSC clock is divided by 1
2DIV2USBHS PLL reference XOSC clock is divided by 2
3DIV4USBHS PLL reference XOSC clock is divided by 4

Bits 19:16 – CFDPRESC[3:0] Clock Failure Detector Prescaler

These bits select the DFLL48oscillator post scaler for the clock fail detector. The CFD safe clock frequency is the DFLL48 frequency divided by 2^CFDPRESC. These bits are XOSCCTRLA.ENABLE protected and cannot be updated if XOSCCTRLA.ENABLE=1

ValueNameDescription
0DIV148 MHz
1DIV224 MHz
2DIV412 MHz
3DIV86 MHz
4DIV163 MHz
5DIV321.5 MHz
6DIV640.75 MHz
7DIV1280.375 MHz
8DIV256187.5 KHz
9DIV51293.75 KHz
10DIV102446.875 KHz
11DIV204823.437 KHz
12DIV409611.718 KHz
13DIV81925.85 KHz
14DIV163842.92 KHz
15DIV327681.46 KHz

Bits 11:8 – STARTUP[3:0] Start-Up Time

These bits select start-up time for the oscillator XOSC according to the table below before a clock fail is acknowledged. The OSCULP32K oscillator is used to clock the start-up counter. These bits are XOSCCTRLA.ENABLE protected and cannot be updated if XOSCCTRLA.ENABLE = 1.

STARTUP[3:0]Number of OSCULP32KClock CyclesApproximate Equivalent Time
0x0131µs
0x1261μs
0x24122μs
0x38244μs
0x416488μs
0x532977μs
0x6641953μs
0x71283906μs
0x82567813μs
0x951215625μs
0xA102431250μs
0xB204862500μs
0xC4096125000μs
0xD (Default)8192250000μs
0xE16384500000μs
0xF327681000000μs
Note:
  1. It is critical when using AGC to allow ample startup time to avoid spurious CFD events.
  2. When using AGC BW = 0x0, the minimum startup time is 6.25 ms.
ValueNameDescription
0CYCLE131 us
1CYCLE261 us
2CYCLE4122 us
3CYCLE8244 us
4CYCLE16488 us
5CYCLE32977 us
6CYCLE641953 us
7CYCLE1283906 us
8CYCLE2567813 us
9CYCLE51215625 us
10CYCLE102431250 us
11CYCLE204862500 us
12CYCLE4096125000 us
13CYCLE8192250000 us
14CYCLE16384500000 us
15CYCLE327681000000 us

Bit 7 – ONDEMAND On Demand Control

The ONDEMAND operation mode allows the XOSC to be enabled or disabled depending on peripheral clock requests.

Note: The XOSC is not running if no peripheral is requesting the clock source.

If ONDEMAND is set, the XOSC will only be running when requested by a peripheral and enabled (XOSCTRLA.ENABLE = 1). If there is no peripheral requesting the XOSC’s clock source, the XOSC will be in a disabled state. If ONDEMAND is disabled, the XOSC will always be running when enabled (XOSCTRLA.ENABLE = 1). In Standby Sleep mode, the ONDEMAND operation is still active. This bit is XOSCCTRLA.ENABLE protected and cannot be updated if XOSCCTRLA.ENABLE = 1.

ValueDescription
0The XOSC is always on.
1The XOSC is running when a peripheral is requesting the XOSC to be used as a clock source.

Bit 5 – SWBEN Xosc Clock Switch Back Enable

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

Note: The SWBEN bit is also cleared when the Clock Failure Detector is disabled (CFDEN = 0).
ValueDescription
0The clock switch back is disabled.
1The clock switch back is enabled. This bit is reset once the XOSC output clock is switched back to the external clock or crystal oscillator.

Bit 4 – CFDEN Clock Failure Detector Enable

This bit controls the XOSC clock failure detector and is enable protected

Note: After setting CFDEN to enable clock failure detection, STATUS.CLKFAIL will always be set. This first detection must be ignored. Subsequent setting of this bit will indicate actual clock failure events.
ValueDescription
0Clock Failure Detector is disabled.
1Clock Failure Detector is enabled.

Bit 3 – XTALEN Crystal Oscillator Enable

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

Note:
  1. If XOSCCTRLA.XTALEN = 0 then XOSCCTRLA.AGC = 1 is not permitted.
  2. This bit is XOSCCTRLA.ENABLE protected and cannot be updated if XOSCCTRLA.ENABLE = 1.
  3. If XOSCCTRLA.XTALEN = 0 then XOSCCTRLB.GMAN (User Manual Gain control) bits are ignored.
ValueDescription
0External clock oscillator connected on XIN. XOUT can be used as general-purpose I/O.
1Crystal connected to XIN and XOUT.

Bit 2 – AGC Auto Gain Control Loop Enable

Note:
  • If XOSCCTRLA.XTALEN = 0 then XOSCCTRLA.AGC = 1 is not permitted.
  • This bit is XOSCCTRLA.ENABLE protected and cannot be updated if XOSCCTRLA.ENABLE = 1.
  • If AGC is enabled, XOSCCTRLB.GMAN (User Manual Gain control) bits are ignored.
  • When the XOSCCTRLA.AGC = 1, the Primary Oscillator will automatically do a linear search to find the lowest power/gain setting to guarantee stable oscillation with the user’s crystal.
ValueDescription
0The oscillator auto gain control loop is disabled.
1The oscillator auto gain control loop is enabled.

Bit 1 – ENABLE Oscillator Enable

ValueDescription
0The oscillator XOSC is disabled.
1The oscillator XOSC is enabled.