English
Language : 

AN1530 Datasheet, PDF (1/12 Pages) STMicroelectronics – ACCURATE TIMEBASE FOR LOW-COST ST7 APPLICATIONS WITH INTERNAL RC OSCILLATOR
AN1530
APPLICATION NOTE
ACCURATE TIMEBASE FOR LOW-COST
ST7 APPLICATIONS WITH INTERNAL RC OSCILLATOR
by Microcontroller Division Applications
INTRODUCTION
The ST7 microcontroller contains an internal RC oscillator, which may vary due to internal
component variation depending upon the surrounding conditions. This can lead to the wrong
calculation of the timing for the different peripherals like Timers, SCI etc. Timing calculation for
the peripheral can be done based on the internal RC frequency given in the datasheet, but due
to the variations in internal RC frequency from component to component, this leads to wrong
timing results in the application.
The purpose of this application note is to present a software solution for accurate timing by cal-
ibrating the internal peripheral parameters against the variation of the internal RC oscillator.
This note focuses on ST7 MCUs with a non-calibrated RC. A 50 Hz, 5 V source is applied as
a reference frequency to find the real internal RC oscillator frequency. The deviation of the in-
ternal frequency with respect to the datasheet frequency is applied to correct the peripheral
parameter values to obtain timing accuracy. This solution provides an innovative way to com-
pensate the internal RC oscillator variation and to develop low cost applications.
Software is developed with using the ST7 software library (available free on the ST web site).
Software shows, how to calibrate PWM signal of TIMER A to produce a 5 KHz frequency. It
also gives an idea of how to calibrate the baud rate of the SCI (here it is calibrated for 9600
baud). An externally calibrated source (ex. Function generator) is used to apply 50 Hz and 5 V
as a reference.
AN1530/0702
1/12
1