Introduction
The STM32G0 series microcontrollers have internal RC oscillators that can be selected as the system clock source. These
are known as the HSI16 (high-speed internal 16 MHz) and LSI (low-speed internal) oscillators. The STM32G0B1xx and
STM32G0C1xx have a secondary internal clock source, the HSI48 (48 MHz (high-speed internal)) that can be used directly for
USB and for RNG (true random number generator).
The operating temperature has an impact on the accuracy of the RC oscillators. At 25°C, the HSI16 oscillator has an accuracy
of 0.25% typically, and the HSI48 accuracy is ±3%. However, in the temperature range of -40 to 105°C, the accuracy decreases.
To compensate for the influence of temperature on internal RC oscillators accuracy, the STM32G0 series microcontrollers have
built-in features to allow users to calibrate the HSI16/HSI48 oscillator, and to measure the LSI (low-speed internal) oscillator
frequency.
This application note focuses on how to calibrate internal RC oscillator HSI16 and HSI48. Three methods are presented:
Method 1 consists in finding the frequency with the minimum error.
Method 2 consists in finding the frequency within the allowed error.
Method 3 consists in preparing the table of calibration values that is later used for fast calibration.
All three methods require an accurate reference signal.
The measurement of the LSI oscillator is performed by connecting the oscillator to a timer input capture.
This application note concerns the STM32G0 series microcontrollers and the X-CUBE-RC-CALIB software.
How to calibrate internal oscillators on STM32G0 MCUs
AN5126
Application note
AN5126 - Rev 2 - April 2023
For further information contact your local STMicroelectronics sales office.
www.st.com
1 General information
This document applies to Arm
®
-based devices.
Note: Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
AN5126
General information
AN5126 - Rev 2
page 2/24