Lab Exercise 6: Digital/Analog conversion logic

advertisement
Elektronikens grunder FK2001
Fysikum
Lab Exercise 6: Digital/Analog conversion logic
Introduction
In this lab exercise, you will study circuits for analog-to-digital and digital-to-analog
conversion
Preparation
Before arriving at the lab, you should do the following:
•
•
Review the lecture notes and handouts.
Read through the lab, and plan the circuits for each section.
Lab setup
For this lab, you will need the following equipment
•
•
•
•
An experiment breadboard
A pulse-generator
An ADC0809 analog-to-digital converter IC
A DAC08 digital-to-analog converter
Exercises
1. Analog-to-digital converter (ADC)
Read and consult the data sheet for the ADC0809 IC for this portion of the lab.
Mount the ADC on your breadboard, and connect the power and ground pins to +5V
and GND, respectively.
You will need an analog voltage signal to test. For this part of the lab connect a
potentiometer between +5V and GND to create an adjustable input to the ADC.
The ADC has eight selectable inputs (IN0 to IN7), but for this lab only one is needed.
Connect your analog input to IN0. The other inputs may be left unconnected.
Select input IN0 by setting all three input address pins (ADD A, B, C) to zero (GND).
To enable latching this address into the ADC, connect the “address latch enable” pin
ALE to high (+5V).
The ADC needs two reference voltages (Vref+ and Vref-) to set the absolute
measurement scale. Since we want to make measurements in the range 0 to 5V,
connect the two Vref pins to power and ground, respectively.
The ADC requires a clock signal as input to perform the conversion. With your
function generator, generate a square wave with frequency around 600 kHz. Use the
Elektronikens grunder FK2001
Fysikum
offset knob to keep the output between 0 and 5V. When you have a good clock signal,
connect it to the clock input pin of the ADC.
To begin a new conversion, the “start conversion” pin (SC) must be set high. At the
end of the conversion, the ADC sets the “end of conversion “ (EOC) pin to high. For
continual conversion of your input signal, connect the EOC output to the SC input, so
that the end of each conversion automatically starts a new one.
Enable the digital output pins D0 to D7 must be enabled by setting the output-enable
(OE) pin to high (+5V). Otherwise the output pins will be high impedance.
Finally, to read the output, connect eight LEDs between the digital output pins and
GND. The internal resistance of the TTL outputs allows them to drive a single LED
without requiring an additional current-limiting resistor. By reading a lit LED as logic
‘1’ and unlit ones as ‘0’, you can read the binary-encoded result.
Draw and label the schematic of your ADC design below (this would be very good to
do before arriving to the lab!)
Power up and test your design. Measure the binary output for several different analog
input voltages, and record your results here:
Elektronikens grunder FK2001
Fysikum
Plot your measurements and fit a line to your results (10 points or so between 0V and
5V). How linear is the ADC scale?
ADC output (counts)
Input voltage (V)
Elektronikens grunder FK2001
Fysikum
2. Digital-to-analog conversion
Now connect and test a high-speed multiplying D/A converter IC. Read and consult
the data sheet for the DAC08 for this portion of the lab.
Connect V+ and V- to +5V and -5V, respectively.
The ADC requires eight parallel digital signals as input. Disconnect the LEDs from
your ADC circuit from section 1 and connect the ADC outputs directly to your DAC
inputs (output 0 to input 0, 1 to 1, and so on). The logic threshold control pin (VLC)
should be left unconnected.
As for the ADC, a DAC also requires two reference voltages to set the output scale.
The positive reference voltage is typically +2V and the negative voltage should be
connected to GND. Do not connect these directly, but make these connections
through ~1k resistors (see Figure 4 in the data sheet, for example) to provide a
reference current. The compensation input (COMP) may be left unconnected.
The output pins drive current, instead of voltage. The maximum value of IO is 2 mA.
To produce an output voltage, connect 2 kΩ resistors between the IO and inverted IO
outputs to GND.
Draw a schematic of your DAC circuit below. Again, it is recommended to plan this
before class.
Elektronikens grunder FK2001
Fysikum
Finally, test your circuit with a few ADC input voltages, and record the resulting
output voltage from your DAC circuit Plot your measurements and fit a line to your
results.
DAC output (V)
Input voltage (V)
If there is time, ask the instructor to help connect a sine-wave input to the ADC,
instead of the variable resistor. With an oscilloscope, observe the DAC response for
different ADC clock frequencies with respect to the sine wave frequency. What
happens as you approach and exceed the Nyquist limit?
Put away your components and show your results to the instructor.
Download