Clocks AN4938
22/46 AN4938 Rev 4
4.1.1 External user clock (HSE bypass)
In this mode, an external clock source must be provided. The user selects this mode by
setting the HSEBYP and HSEON bits in the RCC clock control register (RCC_CR). The
external clock signal (square, sinus or triangle) with ~50% duty cycle has to drive the
OSC_IN pin.
4.1.2 External crystal/ceramic resonator (HSE crystal)
The external oscillator frequency ranges from 4 to 48 MHz. The external oscillator has the
advantage of producing a very accurate main clock. The associated hardware configuration
is shown in Figure 11. Using a 25 MHz oscillator frequency is a good c
hoice to get accurate
Ethernet, USB OTG high-speed peripheral, I2S and SAI.
The resonator and the load capacitors have to be
connected as close as possible to the
oscillator pins in order to minimize the output distortion and startup stabilization time. The
load capacitance values must be adjusted according to the selected oscillator.
For CL1 and CL2 it is recommended to use high-quality ceramic capacitors in the 5 pF to
25 pF range (typical), designed for high-frequency ap
plications and selected to meet the
requirements of the crystal or resonator. CL1 and CL2, are usually the same value. The
crystal manufacturer typically specifies a load capacitance that is the series combination of
CL1 and CL2. The PCB and MCU pin capacitances must be included when sizing CL1 and
CL2 (10 pF can be used as a rough estimate of the combined pin and board capacitance).
The HSERDY flag in the RCC clock control registe
r (RCC_CR) indicates if the high-speed
external oscillator is stable or not. At startup, the clock is not released until this bit is set by
hardware. An interrupt can be generated if enabled in the RCC clock interrupt register
(RCC_CIR).
If it is not used as clock source, the HSE crystal can be switched ON and OFF using the
HSEON
bit in the RCC clock control register (RCC_CR).
4.2 LSE oscillator clock
The low-speed external clock signal (LSE) can be generated from two possible clock
sources:
• LSE user external clock (see Figure 12).
• LSE external crystal/ceramic resonator (see Figure 13).