This document describes the methods for calibrating the internal RC oscillator (HSI) of the STM32F10xxx microcontrollers. By calibrating, the accuracy of the HSI frequency can be improved, which is crucial for communication peripherals.
The document explains that the STM32F10xxx series microcontrollers feature an internal 8 MHz RC oscillator (HSI) with typical accuracy of +1% at 25°C, which can drift up to +3% across a temperature range of -40 to 105°C. To compensate for these variations and improve frequency accuracy for communication peripherals, the note details user runtime calibration routines.
| HSI Nominal Frequency | 8 MHz |
|---|---|
| Typical Accuracy at 25°C | +1% |
| Maximum Accuracy Range (-40 to 105°C) | +3% |
| RTC Reference Frequency | 512 Hz |
The document provides two methods: finding the frequency with the minimum error or finding the maximum allowed frequency error.
User calibration is performed by setting the HSITRIM[4:0] bits in the RCC_CR register.
An accurate reference source such as an RTC/64 signal (512 Hz) or a mains source signal (50 Hz/60 Hz) can be used.