11.3.2.3 Switching Clock Source
The HFRCO oscillator is a low energy oscillator with extremely short start-up time. Therefore, this oscillator is always chosen by hard-
ware as the clock source for HFCLK when the device starts up (e.g. after reset and after waking up from EM2 Deep Sleep and EM3
Stop). After reset, the HFRCO frequency is 19 MHz.
Software can switch between the different clock sources at run-time. For example, when the HFRCO is the clock source, software can
switch to HFXO by writing the field HF in the CMU_HFCLKSEL command register. See
Figure 11.4 CMU Switching from HFRCO to
HFXO before HFXO is ready on page 290
for a description of the sequence of events for this specific operation.
Note:
Before switching the HFCLKSRC to HFXO via the HF bitfield in CMU_HFCLKSEL it is important to first enable the HFXO. Switching to
a disabled oscillator will effectively stop HFSRCCLK and only a reset can recover the system.
When selecting an oscillator which has been enabled, but which is not ready yet, the HFSRCCLK will stop for the duration of the oscilla-
tor start-up time since the oscillator driving it is not ready. This effectively stalls the Core Modules and the High-Frequency Peripherals.
It is possible to avoid this by first enabling the target oscillator (e.g. HFXO) and then waiting for that oscillator to become ready before
switching the clock source. This way, the system continues to run on the HFRCO until the target oscillator (e.g. HFXO) has timed out
and provides a reliable clock. This sequence of events is shown in
Figure 11.5 CMU Switching from HFRCO to HFXO after HFXO is
A separate flag is set when the oscillator is ready. This flag can also be configured to generate an interrupt.
HFXO
CMU_STATUS..HFXORDY
CMU_STATUS.HFXOENS
CMU_STATUS.HFXOSEL
HFRCO
HFCLK
HFXO time-out period
CMU_STATUS.HFRCORDY
CMU_STATUS.HFRCOENS
CMU_STATUS.HFRCOSEL
CMU_OSCENCMD.HFXOEN
CMU_OSCENCMD.HFXODIS
clocks
CMU_CMD.HFCLKSEL
CMU_OSCENCMD.HFRCOEN
CMU_OSCENCMD.HFRCODIS
command
status
00
HFXO
00
Figure 11.4. CMU Switching from HFRCO to HFXO before HFXO is ready
Reference Manual
CMU - Clock Management Unit
silabs.com
| Building a more connected world.
Rev. 1.1 | 290