Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I have to interface AdC 0809 to 8051 in my project. Can anyone give me the programming code for ADC interfacing to 8051?
[COLOR="Green"];=========================================================
; Pin Definations
;=========================================================[/COLOR]
adc_data_bus equ 90h ; Port 0
adc_add_a equ b4h ; P3.4
adc_add_b equ b3h ; P3.3
adc_ale_soc equ b5h ; P3.5
adc_eoc equ b6h ; P3.6
adc_oe equ b7h ; P3.7
[COLOR="Green"];=========================================================
; Main Program starts from here
;=========================================================[/COLOR]
adctemp: clr adc_add_a ; Channel 0 is ie Temp is selected
clr adc_add_b ;Add b = 0, Add a = 0
nop
setb adc_ale_soc ;ale and soc is made high
nop
nop
nop
nop
clr adc_ale_soc ;ale and soc is made low
jb adc_eoc,$ ;check for eoc
jnb adc_eoc,$ ;check for eoc
setb adc_oe ;if eoc high,make oe high
nop
nop
nop
mov a,adc_data_bus ;Read port0 data to accumulator
mov 40h,a ;Copy this data in 40h for furher processing
clr adc_oe ;make oe low
ret
[COLOR="Green"];=========================================================;
Program ENDS here
;=========================================================[/COLOR]