...the world's most energy friendly microcontrollers
2016-04-28 - Giant Gecko Family - d0053_Rev1.20
131
www.silabs.com
There are individual bits for each oscillator indicating the status of the oscillator:
• ENABLED - Indicates that the oscillator is enabled
• READY - Start-up time is exceeded
• SELECTED - Start-up time is exceeded and oscillator is chosen as clock source
These status bits are located in the CMU_STATUS register.
11.3.2.2 Switching Clock Source
The HFRCO oscillator is a low energy oscillator with extremely short wake-up time. Therefore, this
oscillator is always chosen by hardware as the clock source for HFCLK when the device starts up (e.g.
after reset and after waking up from EM2 and EM3). After reset, the HFRCO frequency is 14 MHz.
Software can switch between the different clock sources at run-time. E.g., when the HFRCO is the
clock source, software can switch to HFXO by writing the field HFCLKSEL in the CMU_CMD command
register. See Figure 11.2 (p. 131) for a description of the sequence of events for this specific operation.
Note
It is important first to enable the HFXO since switching to a disabled oscillator will effectively
stop HFCLK and only a reset can recover the system.
During the start-up period HFCLK will stop 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 HFXO and then wait for the oscillator to become ready before switching the clock source. This way,
the system continues to run on the HFRCO until the HFXO has timed out and provides a reliable clock.
This sequence of events is shown in Figure 11.3 (p. 132) .
A separate flag is set when the oscillator is ready. This flag can also be configured to generate an
interrupt.
Figure 11.2. CMU Switching from HFRCO to HFXO before HFXO is ready
HFXO
CMU_STATUS..HFXORDY
CMU_STATUS.HFXOENS
CMU_STATUS.HFXOSEL
HFRCO
HFCLK
HFXO t im e- out period
CMU_STATUS.HFRCORDY
CMU_STATUS.HFRCOENS
CMU_STATUS.HFRCOSEL
CMU_OSCENCMD.HFXOEN
CMU_OSCENCMD.HFXODIS
c
lo
c
k
s
CMU_CMD.HFCLKSEL
CMU_OSCENCMD.HFRCOEN
CMU_OSCENCMD.HFRCODIS
c
o
m
m
a
n
d
s
ta
tu
s
00
02
00
Summary of Contents for Giant Gecko EFM32GG
Page 842: ......