Beruflich Dokumente
Kultur Dokumente
See chapter 13, first article, for the details of ADC0804 IC. Following are the pin configuration of ADC0804:
Testing ADC 0804 on Proteus doesnt need CLK IN and CLK R pin connections but applying that on hardware definitely will need capacitor and resistor at CLK pins as shown above.
The potentiometer value can be changed using up and down arrows. Zoomed potentiometer is shown below.
Finally voltmeter is attached to show the present output voltage of the potentiometer. Vref/2 is not connected which means Vref/2=2.5 Volts or Vref=5 Volts. So the 8 bit digital data has 256 levels with each level equal to 5/256=0.01953125Volts.
Code:
ORG 0H R BIT P3.2 W BIT P3.3 INTR BIT P3.4 MOV P1,#0FFH SETB INTR BACK: ; Read Pin ; Write Pin ; Interrupt Pin ;make P1 = input
CLR W SETB W HERE: JB INTR,HERE CLR R SETB R MOV A,P1 MOV P2,A SJMP BACK
;Write = 0 ;Write = 1 L-to-H to start conversion ;wait for end of conversion ;conversion finished, enable Read ;make Read=1 for next round ;digital data stored in reg. A ;digital data sent to LEDs
END
Sample Check:
Suppose potentiometer output is 3.00 Volts. What should be the digital output? As each level is of 0.0195 Volts so 3.00 volts would be 3/0.01953125=153.8=153.6 level which will be quantized to 153rd level. So digital output should be binary conversion of 153. 153 converted to binary is: 10011001 You can verify it from Proteus scheme as shown below that voltmeter is showing 3.00 Volts and LEDs are showing 10011001.
BEST OF LUCK