Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

AN672 Datasheet(PDF) 2 Page - STMicroelectronics

Part # AN672
Description  When using the internal Analog to Digital Converter of the ST62 family
PDF  3 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN672 Datasheet(HTML) 2 Page - STMicroelectronics

  AN672 Datasheet HTML 1Page - STMicroelectronics AN672 Datasheet HTML 2Page - STMicroelectronics AN672 Datasheet HTML 3Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 2 / 3 page
background image
2/3
Optimizing The St6 A/d Converter Accuracy
;******************** SUBROUTINE AVERAGE ***********************
;description: measures ADC input 256 times and stores average
*
;
of the 256 measures into accumulator
*
;***************************************************************
average
lid ior,10h
; global enable interrupts
clr aver_lo
;aver_lo, aver_hi and count are RAM registers
clr aver_hi
ldi count,255
; set for 256 measurements
aver1
ldi adcc,10110000b
; start conversion with interrupt
wait
ld a,adc
;======================= two byte addition of adc to 16-bit word:
add a, aver_lo
jrnc aver2
inc aver_hi
aver2 ld aver_lo,a
;======================= end of two byte addition
ld a,count
jrz aver4
dec count
jp aver1
;do it 256 times
aver4 ld a,aver_lo
cpi a,127
;round to next value if decimal part >0.5
jrc aver3
inc aver_hi
aver3 ld a, aver_hi ;store high byte of result into accumulator,
ret
;the low byte is not significant
;*********************** interrupt service routine *************
adcint
ldi adcc,10h
reti
;*********************** interrupt vector **********************
.org 0ff0h
jp adcint
2



Html Pages

1 2 3


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