
Table 3.
HSE/LSE clock sources
Clock source
Hardware configuration
External clock
OSC_IN
OSC_OUT
GPIO
External souce
Crystal/ceramic resonators
OSC_OUT
OSC_IN
C
L1
C
L2
Load capacitors
CL1 and CL2 values depend on the quartz. Refer to the application note
Oscillator
design guide for STM8AF/AL/S and STM32 microcontrollers
(AN2867) for more
details.
4.1.1
External crystal/ceramic resonator (HSE crystal)
The 4 to 50 MHz external oscillator has the advantage of producing a very accurate rate on the main clock.
The associated hardware configuration is shown in
. Refer to the electrical characteristics section of the
datasheet for more details.
4.1.2
External source (HSE bypass)
In this mode, an external clock source must be provided, with a frequency up to 50 MHz. The external clock signal
(square, sinus or triangle) with ~40 to 60 % duty cycle depending on the frequency (refer to the datasheet), must
drive the OSC_IN pin while the OSC_OUT pin can be used as a GPIO (see
Note:
For details on pin availability, refer to the pinout section of the datasheet. To minimize the consumption, the
square signal is recommended.
4.2
HSI16 clock
The HSI16 clock signal is generated from an internal 16 MHz RC oscillator. The HSI16 RC oscillator provides
a clock source at low cost (no external components). It also has a faster startup time than the HSE crystal
oscillator. However, even with calibration, the frequency is less accurate than an external crystal oscillator or
ceramic resonator.
The HSI16 clock can be used as a backup clock source (auxiliary clock) if the HSE crystal oscillator fails.
For more details, refer to section 'Clock security system (CSS)' in the reference manual.
4.3
MSI (MSIS and MSIK) clocks
The MSI is made of four internal RC oscillators: MSIRC0 (48 MHz), MSIRC1 (4 MHz), MSIRC2 (3.072 MHz) and
MSIRC3 (400 kHz). Each oscillator feeds a prescaler providing a division by 1, 2, 3 or 4.
Two output clocks are generated from these divided oscillators:
•
MSIS, that can be selected as system clock
•
MSIK, that can be selected by some peripherals as kernel clock
MSIS and MSIK frequency range can be adjusted by software, by using respectively the MSISRANGE [3:0] and
MSIKRANGE [3:0] fields in RCC_ICSCR1 register, with MSIRGSEL = 1. Sixteen frequency ranges are available,
generated from the four internal RCs (see the reference manual for more details).
AN5373
HSI16 clock
AN5373
-
Rev 1
page 18/37