Sei sulla pagina 1di 16

Analog-to-digital converter (ADC )

Need to have some means to convert them into digital signal so


that computers can handle
Analog-to-digital converter (ADC) is a device which can
convert analogue voltage to digital numbers so that
microcontrollers can handle and process the data.
ADC are the most widely used devices for data acquisition
ADC has n-bit resolution, where n can be 8, 12, 16 or even 24
bits.
The higher-resolution ADC provides a smaller step size.
Step size is the smallest change that can be recognized by ADC.
Analog-to-digital converter (ADC )
An ADC has a resolution of 8 bits, the range is divided into 2^8=256
steps (from 0 – 255). But there are 255 quantization levels.

Vcc
Step Size  n
2 1
Vcc is the reference voltage of ADC with n-bit resolution

Table 10.3 : Resolution versus Step Size for ADC (if Vcc = 5V)
n-bit Number of steps Step Size (mV)
8 2^8 = 256 5/255 = 19.61
10 2^10 = 1024 5/1023 = 4.89
12 2^12 = 4096 5/4095 = 1.22
16 2^16 = 65536 5/65535 = 0.076
ADC0804 Chip (Free Running Mode)
+5V
20
10k 6 Vin(+) 18
POT 7 Vin()
D0 Port of
17
8 A GND
D1 8-bit uC
D2 16
9 15
Vref/2
D3 To
14
19 D4 LEDs
CLK R 13
D5
10k 12
4 D6
CLK in 11
150 pF ADC08 D7
1 04
CS
2 WR 3
RD
10 5 Normally
D GND INTR
open
START
Figure 10.1
ADC0804 Chip (Free Running Mode)
Continuous Conversions
(Extracted from Page 11
Of Spec sheet of ADC0804)

CS 1 20 VCC
RD 2 19 CLKR
WR 3 18 D0
CLK 4 17 D1
INTR 5 16 D2
VI+ 6 15 D3
VI- 7 14 D4
AGND 8 13 D5
VREF/2 9 12 D6
DGND 10 11 D7

Pin diagram
ADC0804
(INTR tied to WR with. CS = 0 V)
ADC0804 Chip
CS
Active low input used to activate the ADC0804 chip.

RD (data enable)
Active low input used to get converted data out of the ADC0804
chip. When CS = 0, if a high-to-low pulse is applied to the RD pin,
the 8-bit digital output shows up at the D0-D7 data pins.

WR (start conversion)
Active low input used to inform the ADC0804 to start the
conversion process. If CS = 0 when WR makes a low-to-high
transition, the ADC0804 starts converting the analog input value of
Vin to an 8-bit digital number. When the data conversion is
complete, the INTR pin is forced low by the ADC0804.
ADC0804 Chip
CLK IN and CLK R
Connect to external capacitor and resistor for self-clocking, f =
1/(1.1RC). The clock affect the conversion time and this time cannot
be faster than 110s.

INTR (end of conversion)


This is an active low output pin. When the conversion is finished, it
goes low to signal the CPU that the converted data is ready to be
picked up. After INTR goes low, we make CS = 0 and send a high-to-
low pulse to the RD pin to get the data out of the ADC0804 chip.

Vin (+) and Vin ()


These are the differential analog inputs where Vin = Vin (+)  Vin ().
Often the Vin () pin is connected to ground and the Vin (+) pin is
used as the analog input to be converted to digital.
VREF
2
ADC0804 Chip V
step size  8 2  REF
VCC 2 1 255
This is the +5V power supply. It is also used as a reference voltage
when the Vref/2 (pin 9) input is open.

Vref/2
Input voltage pin used for the reference voltage. If this pin is open, the
analog input voltage for the the ADC is ranged from 0 to 5 volts.

Table 10.4 Vref/2 (V) Vin (V) Step Size (mV)


Not connected 0 to 5 5/255 = 19.60
ADC0804 has
resolution of 2.0 0 to 4 4/255 = 15.69
8 bits 1.5 0 to 3 3/255 = 11.76
1.28 0 to 2.56 2.56/255 = 10.04
1.0 0 to 2 2/255 = 7.84
0.5 0 to 1 1/255 = 3.92
Pin Vref/2 is open, Step size =19.6mV
ADC0804 Chip
D0 – D7
D0 – D7 are the digital data output pins. These are the tri-state
buffered and the converted data is accessed only when CS = 0
and RD is forced low. The output voltage:

Vin
Dout 
Step size

Analog Ground and Digital Ground


Analog ground is connected to the ground of the analog signal
while digital ground is connected to the ground of the Vcc pin.
Question: An analog input voltage of 3.5V, Pin Vref/2 is open.
Signal control on ADC0804

1. Make CS = 0 and send a L-to-H pulse to pin WR to start the


conversion.
2. Keep monitoring the INTR pin. If INTR is low, the conversion
is finished and we can go to the next step. If INTR is high,
keep polling until it goes low.
3. After the INTR has become low, we make CS = 0 and send a H-
to-L pulse to the RD pin to get the data out of the ADC0804 IC
chip.
The timing diagram of ADC0804
CS

WR

D0 – D7 Data out

INTR
Start conversion End conversion
RD

Figure 10.2
Read it
Note: CS is set to low for both RD and WR pulses

Potrebbero piacerti anche