English
Language : 

AN3101 Datasheet, PDF (1/24 Pages) STMicroelectronics – internal RC oscillator calibration
AN3101
Application note
STM8L05xxx/15xxx, STM8L162xx and STM8AL31xx/3Lxx
internal RC oscillator calibration
Introduction
The STM8L05xxx/15xxx, STM8L162xx and STM8AL31xx/3Lxx microcontrollers offer the
possibility of using internal RC oscillators HSI (High-speed internal factory trimmed
oscillator of 16 MHz, typically) or LSI (Low-speed internal low-consumption oscillator of
38 kHz, typically) as clock sources.
The operating temperature and voltage have an impact on RC accuracy. At 3 V and 25 °C,
the HSI has an accuracy of ±1% typically, but in the full temperature and voltage ranges, the
accuracy of the HSI frequency decreases to -5% / +5% (STM8L05xxx), -4.5% / +3%
(STM8L15xxx and STM8L162xx) and -4% / +4% (STM8AL31xx/3Lxx).
To compensate for the influence of temperature and voltage on internal RC oscillator
accuracy, the STM8L05xxx/15xxx, STM8L162xx and STM8AL31xx/3Lxx microcontrollers
provide the capability of calibrating the HSI clock and of measuring the LSI clock.
This application note gives two methods of calibrating the HSI internal RC oscillator. The
first method is based on finding the frequency with the minimum error and the second one
consists in finding the maximum allowed frequency error. Both are implemented by
providing an accurate reference source.
The measurement of the LSI clock is performed by connecting the LSI oscillator to a timer
input capture. Depending on the measured value, peripheral registers are updated to meet
user requirements.
This application note applies to the products listed in Table 1.
Type
Microcontrollers
Table 1. Applicable products
Product lines
– STM8L051/052 Value Line
– STM8L151/152
– STM8L162
– STM8AL31
– STM8AL3L
January 2015
DocID16612 Rev 6
1/24
www.st.com
1