13.6.7 XOSC32K Control

Name: XOSC32KCTRL
Offset: 0x1C
Reset: 0x00000080
Property: Local Write-Protection

Bit 3130292827262524 
 WRTLOCK        
Access R/W 
Reset 0 
Bit 2322212019181716 
          
Access  
Reset  
Bit 15141312111098 
   LPMODE   CSUT[1:0] 
Access R/WR/WR/W 
Reset 000 
Bit 76543210 
 ONDEMAND    XTALENENABLE  
Access R/WR/WR/W 
Reset 100 

Bit 31 – WRTLOCK Write Lock

This bit controls whether the XOSC32K Control register (XOSC32KCTRL) is locked for future writes. When the Write Lock (XOSC32KCTRL.WRTLOCK) bit is ‘1’, the configuration for the XOSC32K oscillator is locked and can only be unlocked by a Device Reset.

Writes to this register, when Local Write-Protection is enabled, will be discarded and return a bus error.

A write access from a debugger will disregard the status of WRTLOCK. Even if the XOSC32KCTRL.WRTLOCK bit is ‘1’, this will not prevent a debugger write to the XOSC32KCTRL register.

A Device Reset will clear this bit to the unlocked state.

ValueDescription
0 The XOSC32K configuration is not locked
1 The XOSC32K configuration is locked

Bit 13 – LPMODE Low Power Mode

This bit selects whether the 32.768 kHz crystal oscillator is set to Low Power mode.

ValueDescription
0 Low Power off
1 Low Power on

Bits 9:8 – CSUT[1:0] Crystal Oscillator Start-Up Time

This bit field selects the start-up time for the crystal oscillator.

If an external clock is selected in the External Source Select bit (XTALEN = ‘0’), the start-up time will not be applied.

ValueNameDescription
0x0 1K 1K XOSC32K cycles
0x1 16K 16K XOSC32K cycles
0x2 32K 32K XOSC32K cycles
0x3 64K 64K XOSC32K cycles

Bit 7 – ONDEMAND On-Demand Operation

Writing a ‘0’ to this bit will cause the XOSC32K oscillator to always run when the Oscillator Enable bit (XOSC32KCTRL.ENABLE) is ‘1’.

Writing a ‘1’ to this bit will cause the XOSC32K oscillator to run only if the XOSC32KCTRL.ENABLE bit is ‘1’ and it is requested by a peripheral. If there no peripherals are requesting the XOSC32K clock source, the XOSC32K oscillator will be in a disabled state.

Refer to the Sleep Mode Operation section for additional information.

ValueNameDescription
0 DISABLE The XOSC32K On-Demand Operation is disabled
1 ENABLE The XOSC32K On-Demand Operation is enabled

Bit 2 – XTALEN External Source Select

This bit selects the external clock source type.

ValueNameDescription
0 EXTCLK External Clock on the XTAL32K1 pin. XTAL32K2 is available for other functions. The CSUT timer is disregarded, and no start-up time is used.
1 XTAL External Crystal connected to the XTAL32K1 and XTAL32K2 pins

Bit 1 – ENABLE Oscillator Enable

Writing a ‘0’ to this bit disables the XOSC32K oscillator, and the respective input pins XTAL32K1 and XTAL32K2 may be configured as I/O pins.
Note: Due to synchronization, to safely disable an enabled XOSC32K oscillator, write the ENABLE bit (XOSC32KCTRL.ENABLE) to '0' without altering any other bits. Then, wait until the ENABLE bit has been synchronized by polling the XOSC32K Ready bit in the STATUS register (STATUS.XOSC32KRDY) until it is ‘0’. After the synchronization is completed, all bits in this register can be freely written to any value.

Writing a ‘1’ to this bit overrides the configuration of the respective input pins to XTAL32K1 and, depending on the XTALEN configuration, potentially XTAL32K2. If the XOSC32KCTRL.ONDEMAND bit is ‘1’, the oscillator is not started unless it is requested as a clock source. If the XOSC32KCTRL.ONDEMAND bit is ‘0’, the oscillator is always running.

ValueNameDescription
0 DISABLED XOSC32K oscillator is disabled
1 ENABLED XOSC32K oscillator is enabled