Assembly code for ADC 0808
Sample code for ADC 0808.
Following code can be using for 8051 and 8052 ICs like: 89c51, 89c52, 89s51, 89s52, 89c2051.
;===================================================== ; Pin Definations ;===================================================== 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 ;===================================================== ; Main Program starts from here ;===================================================== adctemp: clr adc_add_a ;Channel 0 is selected clr adc_add_b ;Add b = 0, Add a = 0 nop setb adc_ale_soc ;ale is made high nop nop clr adc_ale_soc ;soc is made low jb adc_eoc,$ ;check for eoc low jnb adc_eoc,$ ;check for eoc hing setb adc_oe ;if eoc high,make oe high nop nop mov a,data_bus ;Read Port0 data to Acc mov 40h,a ;40h contains output data clr adc_oe ;make oe low ret ;===================================================== ; Program ENDS here ;=====================================================
Highlights
-
List of Projects
Navigate through wide range of projects of 8051. Applications including ADC, DAC, LCD, Matrix LEDs, Keypad, Stepper Motor, DC motor, EEPROM, Relay, Timer, Sensors, RTC and much more.
Pick and Place Robot Temperature & Light Controller Rolling Display Matrix LEDs Person Counter & Password Detector Home Security System Data Logger Greenhouse monitor & control Flow computer Electronic Voting Machine Pick & Place Robot Temperature & Light Controller Rolling Display Matrix LEDs Person Counter & Password Detector Data Logger Home Security System Greenhouse monitor & control Flow computer
Read More