Interfacing ADC804 with 8051 Microcontroller
Interfacing ADC804 with 8051 Microcontroller
(cont’)
R/W tAS tPWH tAH
Department of Computer Science and Information Engineering Department of Computer Science and Information Engineering
HANEL National Cheng Kung University 9
HANEL National Cheng Kung University 10
them
Department of Computer Science and Information Engineering Department of Computer Science and Information Engineering
HANEL National Cheng Kung University 11
HANEL National Cheng Kung University 12
3
+5V power supply
Department of Computer Science and Information Engineering Department of Computer Science and Information Engineering
HANEL National Cheng Kung University 13
HANEL National Cheng Kung University 14
Vref/2 D0-D7
INTERFACING INTERFACING
TO ADC AND ¾ It is used for the reference voltage TO ADC AND ¾ The digital data output pins
If this pin is open (not connected), the analog These are tri-state buffered
SENSORS SENSORS ¾
input voltage is in the range of 0 to 5 volts (the
The converted data is accessed only when CS =
same as the Vcc pin)
ADC804 Chip ADC804 Chip 0 and RD is forced low
If the analog input range needs to be 0 to 4
(cont’) volts, Vref/2 is connected to 2 volts (cont’) ¾ To calculate the output voltage, use the
following formula
Vref/2 Relation to Vin Range
V in
D out =
+5V +5V
Vref/2(v) Vin(V) Step Size ( mV)
6 Vin(+)
20
VCC
18 Not connected* 0 to 5 5/256=19.53 6 Vin(+)
20
VCC
D0 18
step size
D0
7 D1 17 7 D1 17
Vin(-)
2.0 0 to 4 4/255=15.62 Vin(-)
8
9
A GND
Vref /2
D2
D3
16
15
8
9
A GND
Vref /2
D2
D3
16
15 Dout = digital data output (in decimal),
14 1.5 0 to 3 3/256=11.71 D4 14
Vin = analog voltage, and
19 D4 19
13 13
CLK R D5
12
CLK R D5 12
D6
11 1.28 0 to 2.56 2.56/256=10 D6 11
step size (resolution) is the smallest change
D7 D7
4 CLK in
WR
3 1.0 0 to 2 2/256=7.81 4 CLK in
WR
3
INTR 5 INTR 5
1 CS 0.5 0 to 1 1/256=3.90 1 CS
2 RD 2 RD
10 10
D GND Step size is the smallest change can be discerned by an ADC D GND
Department of Computer Science and Information Engineering Department of Computer Science and Information Engineering
HANEL National Cheng Kung University 15
HANEL National Cheng Kung University 16
4
The following steps must be followed
Analog ground and digital ground
INTERFACING INTERFACING for data conversion by the ADC804 chip
¾ Analog ground is connected to the ground
TO ADC AND TO ADC AND ¾ Make CS = 0 and send a low-to-high pulse
of the analog Vin to pin WR to start conversion
SENSORS SENSORS
¾ Digital ground is connected to the ground ¾ Keep monitoring the INTR pin
of the Vcc pin If INTR is low, the conversion is finished
ADC804 Chip ADC804 Chip If the INTR is high, keep polling until it goes low
(cont’) To isolate the analog Vin signal from (cont’) ¾ After the INTR has become low, we make
transient voltages caused by digital CS = 0 and send a high-to-low pulse to the
+5V switching of the output D0 – D7 RD pin to get the data out of the ADC804
6 Vin(+)
20
VCC
18
¾ This contributes to the accuracy of the CS
Department of Computer Science and Information Engineering Department of Computer Science and Information Engineering
HANEL National Cheng Kung University 19
HANEL National Cheng Kung University 20