Reset and clock control (RCC)
External crystal/ceramic resonator (HSE crystal)
The 4 to 48 MHz external oscillator has the advantage of producing a very accurate rate on
the main clock.
The associated hardware configuration is shown in
characteristics section of the datasheet for more details.
The HSERDY flag in the
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
The HSE Crystal can be switched on and off using the HSEON bit in the
register
(RCC_CR).
External source (HSE bypass)
In this mode, an external clock source must be provided. It can have a frequency of up to
48 MHz. You select this mode by setting the HSEBYP and HSEON bits in the
register
(RCC_CR). The external clock signal (square, sinus or triangle) with ~40-60 % duty
cycle depending on the frequency (refer to the datasheet) has to drive the OSC_IN pin while
the OSC_OUT pin can be used a GPIO. See
6.2.2
HSI16 clock
The HSI16 clock signal is generated from an internal 16 MHz RC Oscillator.
The HSI16 RC oscillator has the advantage of providing 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 selected as system clock after wakeup from Stop modes (Stop 0,
Stop 1 or Stop 2). Refer to
clock source (auxiliary clock) if the HSE crystal oscillator fails. Refer to
security system
Calibration
RC oscillator frequencies can vary from one chip to another due to manufacturing process
variations, this is why each device is factory calibrated by ST for 1 % accuracy at T
After reset, the factory calibration value is loaded in the HSICAL[7:0] bits in the
clock sources calibration register
If the application is subject to voltage or temperature variations this may affect the RC
oscillator speed. You can trim the HSI16 frequency in the application using the
HSITRIM[4:0] bits in the
For more details on how to measure the HSI16 frequency variation, refer to
Internal/external clock measurement with
The HSIRDY flag in the
or not. At startup, the HSI16 RC output clock is not released until this bit is set by hardware.
The HSI16 RC can be switched on and off using the HSION bit in the
(RCC_CR).
186/1693
Clock control register (RCC_CR)
Section 6.3: Low-power
(CSS).
(RCC_ICSCR).
Internal clock sources calibration register
Clock control register (RCC_CR)
DocID024597 Rev 3
Figure
13. Refer to the electrical
indicates if the HSE oscillator is
Clock interrupt enable register
Figure
13.
modes. It can also be used as a backup
TIM15/TIM16/TIM17.
indicates if the HSI16 RC is stable
RM0351
(RCC_CIER).
Clock control
Clock control
Section 6.2.9: Clock
=25°C.
A
Internal
(RCC_ICSCR).
Section 6.2.16:
Clock control register
Need help?
Do you have a question about the STM32L4x6 and is the answer not in the manual?