EEWORLDEEWORLDEEWORLD

Part Number

Search

AN1324

Description
CALIBRATING THE RC OSCILLATOR OF THE ST7FLITE0 MCU USING THE MAINS
File Size73KB,15 Pages
ManufacturerSTMicroelectronics
Websitehttp://www.st.com/
Download Datasheet View All

AN1324 Overview

CALIBRATING THE RC OSCILLATOR OF THE ST7FLITE0 MCU USING THE MAINS

AN1324
APPLICATION NOTE
CALIBRATING THE RC OSCILLATOR OF THE
ST7FLITE0 MCU USING THE MAINS
INTRODUCTION
The ST7FLITE0 microcontroller contains an internal RC oscillator which can be trimmed to a
specific frequency with an accuracy of 1%. The oscillator frequency has to be calibrated by
software using the RCCR (RC Control Register). The value entered in the RCCR will switch on
a corresponding number of resistors that will modify the oscillator frequency. Whenever the
ST7FLITE0 microcontroller is reset, the RCCR is restored to its default value (FFh), so each
time the device is reset, you have to load the calibration value in the RCCR. There are prede-
fined calibration values stored in memory (refer to section 7.1 in the ST7FLITE0 datasheet)
You can load one of these values in the RCCR if one of the operating conditions matches that
in your application. Otherwise, you can define your own value, store it in EEPROM or any non-
volatile memory and load it in the RCCR register after each reset. However, if any of the ex-
ternal conditions (temperature or voltage, for instance) change too drastically, the stored value
may no longer produce the required 1% accuracy. One solution is to recalculate the RCCR
value after each reset, based on an external reference.
The purpose of this application note is to present a software solution using the frequency of
the European standard mains (220V/50Hz) as a timebase to adjust the internal RC oscillator
of the ST7FLITE0 to 1 MHz (1%). The same approach can also be used for the US mains
standard (110V/60Hz).
The basic software takes less than 160 ms to calibrate the oscillator and uses less than 90
bytes of program memory and five bytes of RAM for its simplest version. These RAM bytes
can be freed for other purposes when the calibration is done. Another example using averages
is given in this application note. This can be useful with noisy mains
This application note also contains the diagram of a low cost circuit which converts the mains
into a 5 volt power supply and protects the microcontroller from overcurrent on the input con-
nected to the mains.
Rev. 2
AN1324/0604
1/15
1
About OTP Storage
[i=s]This post was last edited by dj狂人 on 2021-8-24 10:30[/i]Hey guys, I have a question. As shown in the figure below, the program storage space of this single chip is in OTP format. I have never und...
dj狂人 51mcu
Ask an expert for help on the address data multiplexing bus of 149
I am using a 149 chip, and I want to use it to read the time information in the clock calendar chip DS12C887. The communication method of DS12C887 is the address data multiplexing line of AD0~AD7. As ...
wdaisni Microcontroller MCU
Ask for program error
Design a logic circuit for four switches to control a lamp. The requirement is that if any switch is turned on, the lamp will turn on; if any switch is turned off, the lamp will turn off. (That is, th...
eeleader FPGA/CPLD
Request two pieces for me!
Apply for two pieces for me! :D :D...
yf654987 NXP MCU
OTP voice chip information
OTP voice chip information...
lnspeed Industrial Control Electronics
I encountered several problems when looking at Zhongying's SH367X series of lithium battery protection chips.
I encountered several problems when looking at Zhongying's SH367X series of lithium battery protection chips....
QWE4562009 Discrete Device

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Robot
development
community

Index Files: 2336  2134  692  2788  1693  48  43  14  57  35 
Datasheet   0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Room 1530, 15th Floor, Building B, No. 18 Zhongguancun Street, Haidian District, Beijing Telephone: (010) 82350740 Postal Code: 100190
Copyright © 2005-2026 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号