数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

AN1324 数据表(PDF) 13 Page - STMicroelectronics

部件名 AN1324
功能描述  CALIBRATING THE RC OSCILLATOR OF THE ST7FLITE0 MCU USING THE MAINS
PDF  15 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

AN1324 数据表(HTML) 13 Page - STMicroelectronics

Back Button AN1324 Datasheet HTML 7Page - STMicroelectronics AN1324 Datasheet HTML 8Page - STMicroelectronics AN1324 Datasheet HTML 9Page - STMicroelectronics AN1324 Datasheet HTML 10Page - STMicroelectronics AN1324 Datasheet HTML 11Page - STMicroelectronics AN1324 Datasheet HTML 12Page - STMicroelectronics AN1324 Datasheet HTML 13Page - STMicroelectronics AN1324 Datasheet HTML 14Page - STMicroelectronics AN1324 Datasheet HTML 15Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 13 / 15 page
background image
13/15
CALIBRATING THE RC OSCILLATOR OF THE ST7FLITE0 MCU USING THE MAINS
nocarry sub
A, (capture1,Y);MSB are in register X
jrnc
noneg
;
dec
X
;and LSB in register A.
noneg
inc
Y
cp
Y,#$4
jrne
calcul
srl
A
;these lines calculate the average of the last four
srl
X
;measures by dividing their total by 4. It is done by
jrnc
carry1
;two consecutive right shift on the 16 bit result.
add
A,#$80
carry1 srl
A
srl
X
jrnc
carry2
add
A,#$80
carry2 cp
X, #$01
;if mains frequency is 50Hz the reference value is $138
jrmi
minus
;if it is 60Hz the reference is $104.the program first
jreq
compare
;compares MSB with $01 and then compare LSB with
jp
plus
;$38 for 50Hz and $04 for 60Hz. if the calculated
compare cp
A, #$38
;value is smaller than the reference the program jump to
jrmi
minus
;minus to decrease RCCR else it increase RCCR
plus
ld
A, RCCR
add
A, value
;add value if counted value is greater than ref
jp
new
minus
ld
A, RCCR
sub
A, value
;subtract value if Y is smaller
new
ld
RCCR,A
;enter the new value in RCCR
btjf
value, #0, next;stop after 7 rounds
loop
jp
loop
4.2.2 input capture interrupt
ld
A, LTICR
;load captured value in A
btjt
LTCSR, #4, finish
;test if it is first or second capture
bset
LTCSR, #4
;allow timebase interrupt in order to count the
number of overflows
ld
capture1, A
;captured value is stored in capture1
jp
endit1
finish ld
capture2, A
;if it is the second capture, captured value is
stored in capture2
clr
cr
;clear cr to end the count
endit1 iret
4.2.3 timebase interrupt
ld
A, LTCSR
;clear TB bit
inc
nbover
;increment number of overflows
endit2 iret



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
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