16.8.6 32kHz External Crystal Oscillator (XOSC32K) Control
Name: | XOSC32K |
Offset: | 0x14 |
Reset: | 0x0080 |
Property: | Write-Protected |
Bit | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | |
WRTLOCK | STARTUP[2:0] | ||||||||
Access | R/W | R/W | R/W | R/W | |||||
Reset | 0 | 0 | 0 | 0 |
Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
ONDEMAND | RUNSTDBY | AAMPEN | EN32K | XTALEN | ENABLE | ||||
Access | R/W | R/W | R/W | R/W | R/W | R/W | |||
Reset | 1 | 0 | 0 | 0 | 0 | 0 |
Bit 12 – WRTLOCK Write Lock
This bit locks the XOSC32K register for future writes to fix the XOSC32K configuration.
Value | Description |
---|---|
0 | The XOSC32K configuration is not locked. |
1 | The XOSC32K configuration is locked. |
Bits 10:8 – STARTUP[2:0] Oscillator Start-Up Time
These bits select the start-up time for the oscillator.
The OSCULP32K oscillator is used to clock the start-up counter.
STARTUP[2:0] | Number of OSCULP32K Clock Cycles | Number of XOSC32K Clock Cycles | Approximate Equivalent Time (OSCULP = 32kHz)(1)(2)(3) |
---|---|---|---|
0x0 | 1 | 3 | 122μs |
0x1 | 32 | 3 | 1068μs |
0x2 | 2048 | 3 | 62592μs |
0x3 | 4096 | 3 | 125092μs |
0x4 | 16384 | 3 | 500092μs |
0x5 | 32768 | 3 | 1000092μs |
0x6 | 65536 | 3 | 2000092μs |
0x7 | 131072 | 3 | 4000092μs |
Notes: 1. Number of cycles for the start-up counter.
2. Number of cycles for the synchronization delay, before PCLKSR.XOSC32KRDY is set.
3. Start-up time is n OSCULP32K cycles + 3 XOSC32K cycles.
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 ONDEMAND bit has been previously written to one, the oscillator will only be running 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 XOSC32K.RUNSTDBY bit is one. If XOSC32K.RUNSTDBY is zero, the oscillator is disabled.
Value | Description |
---|---|
0 | The oscillator is always on, if enabled. |
1 | The 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 XOSC32K behaves during standby sleep mode:
Value | Description |
---|---|
0 | The oscillator is disabled in standby sleep mode. |
1 | The oscillator is not stopped in standby sleep mode. If XOSC32K.ONDEMAND is one, the clock source will be running when a peripheral is requesting the clock. If XOSC32K.ONDEMAND is zero, the clock source will always be running in standby sleep mode. |
Bit 5 – AAMPEN Automatic Amplitude Control Enable
Value | Description |
---|---|
0 | The automatic amplitude control for the crystal oscillator is disabled. |
1 | The automatic amplitude control for the crystal oscillator is enabled. |
Bit 3 – EN32K 32kHz Output Enable
This bit controls the connections between the I/O pads and the external clock or crystal oscillator:
Value | Description |
---|---|
0 | The 32kHz output is disabled. |
1 | The 32kHz output is enabled. |
Bit 2 – XTALEN Crystal Oscillator Enable
This bit controls the connections between the I/O pads and the external clock or crystal oscillator:
Value | Description |
---|---|
0 | External clock connected on XIN32. XOUT32 can be used as general-purpose I/O. |
1 | Crystal connected to XIN32/XOUT32. |
Bit 1 – ENABLE Oscillator Enable
Value | Description |
---|---|
0 | The oscillator is disabled. |
1 | The oscillator is enabled. |