Department of Computer Science and Information EngineeringNational Cheng Kung University
13
INTERFACING TO ADC AND SENSORSADC804 Chip (cont’) HANEL
+5V^206789194351210
10kPOT 10k150 pF
To LEDs normallyopenSTART
Vin(+)D0D1Vin(-)D2A GNDD3/2VrefD4CLK RD5D6D7CLK inCSRDD GND
+5V power supply or a reference voltage when V/2 input is open ref(not connected)VCC^1817161514131211 WRINTR
Differential analog inputs where Vin(-)= V(+) – VininVin (-) is connected to ground and Vin(+) is used as the analog input to be convertedCS is an active low input used to activate ADC804“end of conversion”When the conversion is finished, it goes low to signal the CPU that the converted data is ready to be picked up
“output enable”a high-to-low RD pulse is used to get the 8-bit converted data out of ADC804
“start conversion”When WR makes a low-to-high transition, ADC804 starts converting the analog input value of V
to an 8-in
bit digital number
Department of Computer Science and Information EngineeringNational Cheng Kung University
14
INTERFACING TO ADC AND SENSORSADC804 Chip (cont’) HANEL
CLK IN and CLK R¾CLK IN is an input pin connected to an external clock source¾To use the internal clock generator (also called self-clocking), CLK IN and CLK R pins are connected to a capacitor and a resistor, and the clock frequency is determined by Typical values are R = 10K ohms and C = 150 pFWe get
(^1) =fRC (^1). (^1) = 606 kHz and the conversion time f μsis 110
+5V^20 VCC 618 D0Vin(+) 717 D1Vin(-)^168 D2A GND^159 D3/2V^14 refD4 1913 CLK RD5^12 D6^11 D7 43 CLK inWR^5 INTR 1 CS 2 RD 10 D GND
Department of Computer Science and Information EngineeringNational Cheng Kung University
15
INTERFACING TO ADC AND SENSORSADC804 Chip (cont’) HANEL
Vref/2¾It is used for the reference voltageIf this pin is open (not connected), the analog input voltage is in the range of 0 to 5 volts (the same as the Vcc pin)If the analog input range needs to be 0 to 4 volts, V
ref/2 is connected to 2 volts
Vref/2 Relation to V
inRange 1/256=3.900 to 1
0.5
2/256=7.81
0 to 2
1.0
2.56/256=10
0 to 2.56
1.28
3/256=11.71
0 to 3
1.5
4/255=15.62
0 to 4
2.0
5/256=19.53
0 to 5
Not connected*
Step Size ( mV)
Vin(V)
Vref/2(v) Step size is the smallest change
can be discerned by an ADC
+5V^20 VCC 618 Vin(+)D0 717 D1Vin(-)^168 D2A GND^159 D3^14 /2VrefD4 1913 CLK RD5^12 D6^11 D7 4 CLK in^3 WR^51 INTRCS 2 RD 10 D GND
Department of Computer Science and Information EngineeringNational Cheng Kung University
16
INTERFACING TO ADC AND SENSORSADC804 Chip (cont’) HANEL
D0-D7¾The digital data output pins¾These are tri-state buffered The converted data is accessed only when CS = 0 and RD is forced low¾To calculate the output voltage, use the following formulaDout
= digital data output (in decimal), Vin= analog voltage, and step size(resolution) is the smallest change
V sizestep
D
in=out
+5V^20 VCC 618 D0Vin(+) 717 D1Vin(-) 816 D2A GND^159 D3/2V^14 refD4 1913 CLK RD5^12 D6^11 D7 4 CLK in^3 WR^51 INTRCS 2 RD 10 D GND