...the world's most energy friendly microcontrollers
2014-07-02 - Tiny Gecko Family - d0034_Rev1.20
106
www.silabs.com
Figure 11.5. LFXO Pin Connection
EFM32
LFXTAL_N
LFXTAL_P
32.768kHz
C
L1
C
L2
It is possible to connect an external clock source to HFXTAL_N/LFXTAL_N pin of the HFXO or LFXO
oscillator. By configuring the HFXOMODE/LFXOMODE fields in CMU_CTRL, the HFXO/LFXO can be
bypassed.
11.3.3.2 HFRCO, LFRCO and AUXHFRCO
It is possible to calibrate the HFRCO, LFRCO and AUXHFRCO to achieve higher accuracy (see the
device datasheets for details on accuracy). The frequency is adjusted by changing the TUNING fields
in CMU_HFRCOCTRL/CMU_LFRCOCTRL/CMU_AUXHFRCOCTRL. Changing to a higher value will
result in a higher frequency. Please refer to the datasheet for stepsize details.
The HFRCO and AUXHFRCO can be set to one of several different frequency bands from 1 MHz to 28
MHz by setting the BAND field in CMU_HFRCOCTRL and CMU_AUXHFRCOCTRL.The HFRCO and
AUXHFRCO frequency bands are calibrated during production test, and the production tested calibration
values can be read from the Device Information (DI) page. The DI page contains a separate tuning value
for each frequency band. During reset, HFRCO and AUXHFRCO tuning values are set to the production
calibrated values for the 14 MHz band, which is the default frequency band. When changing to a different
HFRCO or AUXHFRCO band, make sure to also update the tuning value.
The LFRCO and is also calibrated in production and its TUNING value is set to the correct value during
reset.
The CMU has built-in HW support to efficiently calibrate the RC oscillators at run-time, see Figure 11.6 (p.
107) The concept is to select a reference and compare the RC frequency with the reference frequency.
When the calibration circuit is started, one down-counter running on a selectable clock (DOWNSEL in
CMU_CALCTRL) and one up-counter running on a selectable clock (UPSEL in CMU_CALCTRL) are
started simultaneously. The top value for the down-counter must be written to CMU_CALCNT before
calibration is started. The smallest value that can be written to the CMU_CALCNT is 1. The down-counter
counts for CMU1 cycles. When the down-counter has reached 0, the up-counter is sampled
and the CALRDY interrupt flag is set. If CONT in CMU_CALCTRL is cleared, the counters are stopped
at this point. If continuous mode is selected by setting CONT in CMU_CALCTRL the down-counter
reloads the top value and continues counting and the up-counter restarts from 0. Software can then
read out the sampled up-counter value from CMU_CALCNT. Then it is easy to find the ratio between
the reference and the oscillator subject to the calibration. Overflows of the up-counter will not occur. If
the up-counter reaches its top value before the down counter reaches 0, the top counter stays at its top
value. Calibration can be stopped by writing CALSTOP in CMU_CMD. With this HW support, it is simple
to write efficient calibration algorithms in software.
Summary of Contents for EFM32TG
Page 543: ......