Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

2.

3 ANALOG TO DIGITAL CONVERTER – ADC(0804)

Analog to digital converters are among the most widely used devices for data
acquisition. Digital computers use binary values, but in physical world everything is analog.
Temperature, pressure, humidity, are a few examples of physical quantities that we deal with every
day. A physical quantity is converted to electrical signals using a device called a transducer.
Transducers are also referred to as sensors. Sensors for temperature, velocity, pressure, light, and
many other natural quantities produce an output that is voltage (or current). Therefore, we need an
analog to digital converter to translate analog signals to digital numbers so that microcontroller
can read and process them. An ADC has n-bit resolution where n can be 8,10,12,16 or even 24
bits. The higher resolution ADC provides smaller step size, where step size is the smallest change
that can be discerned by an ADC. In addition to resolution, converter time is another major factor
in judging an ADC. Conversion time is defined as the time it takes the ADC to convert the analog
input to digital number. Commonly used ADC device ADC804
ADC0804 CHIP:

The ADC0804 IC is an 8 bit parallel ADC in the family of the ADC0800 series.
In ADC0804, the conversion time varies depending on the clocking signals applied to the CLK IN
pin, but it cannot be faster than 110micro seconds.

Pin diagram:

10
• CS – Chip Select , active low
• RD – Read Digital data from ADC, H-L edge triggered
• WR -- Start conversion, L-H pulse edge triggered
• INTR -- end of conversion, Goes low to indicate conversion done
• Data bits -- D0-D7
• CLK IN & CLK R
– CLK IN is an input pin connected to an external clock source when an external clock is used
for timing. However, ADC804 has an internal clock
generator.
To use the internal clock generator of the ADC804, the CLK IN and CLK R pins are connected
to a capacitor and a resistor. In that case, the
clock frequency is determined by the equation.
f = 1/1.1RC
R=10K and C=150pF f=606Hz
the conversion time is 110us.

Input Voltage range


• Default 0-5V. Can be changed by setting different Vref/2 Vin Step size
value for Vref/2 pin. (Volts) (Volts) (mV)
Vin=Vin(+) – Vin (-) Open (2.5) 0 to 5 5/256 = 19.53
2.56 0 to 5.12 5.12/256 =20
• Range = 0 to 2x Vref/2.
1.28 0 to 2.56 2.56/256 = 10
for Vin = 2x Vref/2. we get 256 as a digital output
0.5 0 to 1 1/256=3.90
on D0-D7. (Refer Table)

•Step Size is a Smallest change


– (2 x Vref/2)/ 256 for ADC804
for eg for step size 10mv ,digital output on D0-D7 changes by one count for every 10mv change
of the input analog voltage.

DataOut
Dout = Vin / Step Size

11
for input vtg. of 2.56 volts (Vref=1.28 volts) and step size of 10mv Dout =2560/10 =256 or FF
that is full scale output.

Resolution
8 bits for ADC804

INTERFACING ADC804 TO 89C52

Signals to be interfaced (on the ADC804)


– D0-D7, RD, WR, INTR, CS
Can do both Memory mapping and IO mapping

Memory Mapping (timing is critical)


– Connect D0-D7 of ADC804 to the data bus of the 8051 system
– Connect RD, WR of the ADC804 to the 8051 system (ensure polarity)
– Connect CS of ADC804 to an appropriate address decoder output
– Connect INTR of ADC804 to an external interrupt Pin on the 8051 (INT0 or INT1)

IO Mapping (easiest - I prefer )


– Connect D0-D7, RD, WR, CS, INTR to some port bits on the 8051 (12 in all).
Algorithm
• Make CS=0 and send a low-to-high to pin WR to start the conversion.
• Keep monitoring INTR
– If INTR =0, the conversion is finished and we can go to the next step.
– If INTR=1, keep polling until it goes low.
• After INTR=0, we make CS=0 and send a high-to-low pulse to RD to get the data out of the
ADC804 chip.

12
1.13

13

You might also like