English
Language : 

AN1827 Datasheet, PDF (8/11 Pages) STMicroelectronics – IMPLEMENTATION OF SIGMA-DELTA ADC
IMPLEMENTATION OF SIGMA-DELTA ADC WITH ST7FLITE05/09
ld ATRH,a
ld a,#$70
ld ATRL,a
ld a,#%00010010
ld ATCSR,a
rim
;**********************************************************************
;Main loop of the program
;**********************************************************************
IDLE:
btjf FLAGS0,#Nw_adc,Idle ; waiting for the conversion result
bres FLAGS0,#Nw_adc
; new result
; sending the conversion result
; through RS
ld a,#$FF
; frame format:
call Send_rs
;0FFh,0FFh,Rez_H,Rez_L
ld a,#$FF
call Send_rs
ld a,Rez_h
call Send_rs
ld a,Rez_l
call Send_rs
jra IDLE
;**********************************************************************
;Interrupts
;**********************************************************************
; delta/sigma conversion
; sampling of 1 bit with period of 50us
; conversion result- 10 bit word, received every (1024*50us)=51,2ms
;**********************************************************************
timoverfl_rt:
bres ATCSR,#2
; cancelling of the interrupt re-
; quest
ld a,#00000100
; adding the amplifier into the A/D
; processing
ld ADCCAMP,a
ld a,#%01100001
; voltage measurement at AIN1
ld ADCCSR,a
loop_adc:
btjf ADCCSR,#7,loop_adc
ld a,ADCDR
cp a,#$37
; comparison U_ain1 z 037h
jrc set_Dlt
bres PBDR,#Dlt_out
; U_ain1>037h
inc Adc_l
; increase of the conversion result
8/11