STMicroelectronics AN2822 STM8S/STM8A High Speed Internal Oscillator Calibration Application Note

This application note describes how to take advantage of the 16 MHz internal RC oscillator trimming feature on the STM8S and STM8A microcontroller to improve the frequency accuracy of the system compensating voltage and temperature frequency drift. The calibration technique, using the mains frequency as a timebase, is presented with an example of both hardware and software solutions. The example source code can be downloaded from the www.st.com. To benefit fully from the information in this application note, the user should be familiar with the STM8S and STM8A microcontroller architecture and with the basics of C language. For further information on the STM8S and STM8A family features, pinout, electrical characteristics, mechanical data and ordering information, please refer to the STM8S and STM8A datasheets. This document and its associated firmware, are written to accompany the STM8S and STM8A firmware library. Please contact STMicroelectronics for information on the STM8S and STM8A firmware library.


STMicroelectronics AN2822 STM8S/STM8A High Speed Internal Oscillator Calibration Application Note - cover page
Brand
STMicroelectronics
Category
microcontrollers
Document type
Application Note
Language
English
Pages
19
File format
PDF
File size
196 KB
Published
07 August, 2012
Updated
29 September, 2023
Models
STM8S, STM8A
MD5 checksum
65990E57EF36E5A2EB429C80B5AF2688

About this manual

This document details how to utilize the 16 MHz internal RC oscillator (HSI) trimming feature on STM8S and STM8A microcontrollers to compensate for frequency drift caused by temperature and voltage variations. The technique uses the mains frequency as a reference timebase to calibrate the oscillator frequency in real-time.

What's inside

  • High speed internal oscillator trimming
  • Calibration principle
  • Calibration routine
  • Measurement of HSI pulses
  • Timing of calibration period
  • Uncertainty of calibrated HSI frequency
  • Power supply and calibration signal conditioning circuit
  • Revision history

Specifications

Nominal HSI frequency16 MHz
Factory calibration temperature25 °C
Factory calibration supply voltage5 V
Calibration period duration20 ms
Trimming range-4 to +3

Frequently asked questions

What is the purpose of the HSI calibration routine?

To improve frequency accuracy by compensating for temperature and voltage drift affecting the RC oscillator output.

What is used as the reference timebase for calibration?

The post-processed signal from the mains power source is used as a reference timebase.

Download PDF (196 KB)

More STMicroelectronics Manuals


View all STMicroelectronics manuals →