Electronic Components Datasheet Search
  English  ▼

X  

AN2326 Datasheet(PDF) 3 Page - STMicroelectronics

Part # AN2326
Description  Calibrating the RC oscillator of the ST7ULTRALITE MCU using the mains
PDF  20 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2326 Datasheet(HTML) 3 Page - STMicroelectronics

  AN2326 Datasheet HTML 1Page - STMicroelectronics AN2326 Datasheet HTML 2Page - STMicroelectronics AN2326 Datasheet HTML 3Page - STMicroelectronics AN2326 Datasheet HTML 4Page - STMicroelectronics AN2326 Datasheet HTML 5Page - STMicroelectronics AN2326 Datasheet HTML 6Page - STMicroelectronics AN2326 Datasheet HTML 7Page - STMicroelectronics AN2326 Datasheet HTML 8Page - STMicroelectronics AN2326 Datasheet HTML 9Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 3 / 20 page
background image
Obsolete
Product(s)
- Obsolete
Product(s)
Obsolete
Product(s)
- Obsolete
Product(s)
AN2326
Calibration software
3/20
1
Calibration software
1.1
Software principle
The software algorithm, described in the following flowchart (see Figure 3.), uses the mains
frequency as a timebase. This timebase allows the microcontroller to test if the RC oscillator
frequency is above or below the targeted frequency and repeatedly transforms it by
dichotomous analysis so that in 10 iterations the RCCR/SICSR registers are set to the
optimum value. In order to simplify the calculation, the calibration is done at 1MHz, the
8MHz internal RC is divided by 8 thanks to the AVTCHR register.
As the timer speed depends on the RC oscillator frequency, it is easy to determine if the
oscillator is too fast or too slow. The counted value can be obtained by the following
equation:
Since the frequency of the counter is the frequency of the oscillator divided by 32 (only the 8
MSbits are saved on the 13 bits of the counter), if the oscillator is at 1 MHz, the result of the
count between two edges (which have a 10 ms interval), is 138h for the European standard
(220V/50Hz). For the US standard (110V/60Hz) the right value is 104h. Since the goal of the
software is to set the RC oscillator frequency to 1 MHz it means obtaining 138h as the result
of the count. So if the result of the count is greater than 138h, it means that the frequency is
too high so the program increases the value of RCCR/SICSR registers in order to decrease
the RC oscillator frequency. And if the result is less than 138h, the RCCR/SICSR register
value is decreased in order to increase the RC oscillator frequency.
Figure 1.
Dichotomous analysis of RCCR value
The RCCR register is set to 80h initially by the program, then the dichotomization starts by
adding or subtracting 40h and after each iteration the result is divided by two, so that after
10 iterations the value of RCCR is set with an accuracy of one bit.
countedvalue
f
cpu
32
f
mains
×
----------------------------
=
80h
Start Value
FFh
0h
increase oscillator
frequency
decrease oscillator
frequency
RCCR Register



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com