
DocID026156 Rev 1 17/34
AN4467 Clocks
33
2 Clocks
Four different clock sources can be used to drive the system clock (SYSCLK):
•HSI16 (high-speed internal) oscillator clock
•HSE (high-speed external) oscillator clock
•PLL clock
•MSI (multispeed internal) oscillator clock
The MSI is used as a system clock source after startup from reset, wake-up from Standby
low-power modes.The MSI, HSI16 or HSI16 divided by four, are used as a system clock
source after wake-up from Stop low-power mode.
The devices have the following two secondary clock sources:
•37 kHz low speed internal RC (LSI RC) which drives the independent watchdog and
optionally the RTC used for auto-wakeup from Stop/Standby mode.
•32.768 kHz low speed external crystal (LSE crystal) which optionally drives the
real-time clock (RTCCLK)
The STM32L0x2 and STM32L0x3 have HSI48 (high-speed internal) oscillator clock
available for USB and Random generator. This permits a USB communication without the
need for external clock source.
Each clock source can be switched on or off independently when it is not used, to optimize
power consumption.
Refer to the STM32L0xx reference manual (RM0367, RM0376, RM0377) for a description
of the clock tree.
2.1 MSI clock
The MSI clock signal is generated from an internal RC oscillator. Its frequency range can be
adjusted by software through the RCC_ICSCR register. Seven frequency ranges are
available: 65.5 kHz, 131 kHz, 262 kHz, 524 kHz, 1.05 MHz, 2.1 MHz (default value) and
4.2 MHz. Those frequencies are multiple values of 32.768 kHz.
The MSI clock is used as a system clock after a restart from reset.
The MSI RC oscillator has the advantage of providing a low-cost (no external components)
low-power clock source. It is used as a wakeup clock in low-power modes to reduce power
consumption and wakeup time.
The MSIRDY flag in the RCC_CR register indicates wether the MSI RC is stable or not. At
startup, the MSI RC output clock is not released until this bit is set by hardware.
The MSI RC can be switched on and off through the RCC_CR register (default is on).
Calibration
If the application is subject to voltage or temperature variations, this may affect the RC
oscillator speed. You can trim the MSI frequency in the application through the RCC_ICSCR
register. Typically, this uses the HSE or LSE as reference (see RM0367/376/377 for details
on clock measurement with TIM21). For more information refer to AN3300 “How to calibrate
an STM32Lxx internal RC oscillator”.