ST7 MCU Accurate Timebase Application Note AN1530

This document describes the features and characteristics of the ST7 microcontroller, specifically the accurate timebase application using the internal RC oscillator.


ST7 MCU Accurate Timebase Application Note AN1530 - cover page
Brand
STMicroelectronics
Category
microcontrollers
Document type
Application Note
Language
English
Pages
12
File format
PDF
File size
69 KB
Published
07 August, 2012
Updated
28 September, 2023
MD5 checksum
2E05A2BF91FAF91972626A3788B849E5

About this manual

The document addresses timing inaccuracies caused by variations in the internal RC oscillator found in ST7 microcontrollers. It proposes a software-based calibration method that measures the actual frequency against an external reference (such as 50 Hz mains power) to calculate a deviation fraction.

This calculated fraction is then applied to correct parameters for peripherals such as Timer A PWM and SCI baud rate generators. The note details two algorithms: a basic version taking approximately 30ms and an advanced averaging/glitch filtering version taking about 325ms, providing improved accuracy for low-cost applications.

What's inside

  • Introduction
  • Measurement Principle
  • BASIC ALGORITHM
  • AVERAGING AND GLITCH ALGORITHM
  • Calibration of Peripheral Parameters
  • PWM Counter Calibration
  • SCI Baud Rate Calibration
  • Conclusion

Frequently asked questions

How long does the basic calibration algorithm take to execute?

The basic software routine takes less than 30ms to find the fraction and deviation of the real RC frequency.

What accuracy can be expected for the calibrated PWM counter?

The calibration provides a frequency accuracy of approximately 1.05% for a 5 KHz generation.

What accuracy can be expected for the calibrated SCI baud rate?

The calibration provides a baud rate accuracy of approximately 3.84% for a 9600 baud setting.

Download PDF (69 KB)

More STMicroelectronics Manuals


View all STMicroelectronics manuals →