• No results found

ECE 35 Lab 2_V17.pdf

N/A
N/A
Protected

Academic year: 2020

Share "ECE 35 Lab 2_V17.pdf"

Copied!
6
0
0

Loading.... (view fulltext now)

Full text

(1)

ECE 35 Project 2 Digital to Analog Converter (DAC)

The objective of this project is to analyze, build, and test a 4-bit Digital to Analog Converter (DAC) based

on an R/2R ladder network. DACs and their twin brother, ADCs are core components for any electronics

with a microprocessor brain. Take digital cameras for example: The sensor behind the lens collects

brightness and color information. These are analog signals that are subsequently converted to binary

numbers via ADC for the processor to compute and record to the memory card. In the back of the

camera, a DAC will read each digital input and restore them to corresponding analog levels to power

each pixel on the LCD display with correct brightness and color.

In this lab, an up-down counter will drive the DAC input and its output analog voltage will be measured

with an oscilloscope. The up-down counter is a discrete CMOS chip which we will power with a 5V

supply and clock with a square wave function generator. The counter will be tested with a logic analyzer.

Keep in mind, a complete analog design project includes design, analysis, simulation, building, and

testing. In this project, a basic design is provided to you and we will skip the circuit simulation. Instead

you will be performing analysis to confirm that the design is correct and then build and test the circuit.

Analysis

You must complete the analysis before your lab section.

The R/2R ladder network shown below can be most easily analyzed using superposition and source

transformation where each is appropriate. We can use superposition in any circuit that is linear and we

can use source transformation on any independent current or voltage source. The goal of the analysis is

to find an expression for the output voltage, Vanalog. Remember, when utilizing superposition, any

source you are not isolating gets shorted if it is a voltage source and opened if it is a current source.

Here each voltage source (V0~V3) represents the voltage input from each digital output of the counter

(2)

within this circuit. Start with Vanalog = ∑aV. In calculating the output voltage of each source, it is

recommended that you start with the most significant bit (MSB), solve the circuit for output (Vanalog)

and then do the next most significant bit; using mathematical induction will greatly simplify your work.

The final result will have the form:

Vanalog = a

0

V

0

+ a

1

V

1

+ a

2

V

2

+ a

3

V

3

.

Explain in your report the method you chose to solve for Vanalog and discuss the result.

Report

As before, you must write a report showing and explaining your analysis of the project and exactly what

you did in the lab and the results of your testing. This report must include hard copy plots

demonstrating that the counter and the DAC work as expected. Your report should be chronological—

analysis of the problem you are resolving should obviously go before building and testing of the solution.

Start with the analysis, making sure to answer any questions that are directly asked in the instructions in

italics. The report should be written such that a technically literate person could repeat your work and

obtain the same results.

In addition to questions asked throughout these lab guidelines in italics, discuss in your lab report:

 The relationship between the symmetry of the ladder circuit and the equation you obtained for Vanalog. Would the expression of Vanalog change if the symmetry of the circuit were broken?

 Qualitatively explain the behavior of the counter chip, CD4516, and how it was utilized for this project.

 What are the advantages and disadvantages of using the logic analyzer instead of using an oscilloscope?

 Qualitatively explain what changes you see when you change the voltage at pin 10 of the counter chip.

 Explicitly explain why Vanalog has the “staircase” shape when you measured it with the oscilloscope.

(3)

Lab Notes

Counter Chip

If you have not taken the equivalent of ECE25, you may not have seen a counter chip before. A counter

is a sequential circuit that has N bits of memory, which can be considered an N bit binary word. When

the CLOCK input rises from zero to one, the word is either incremented or decremented by one

depending on the state of the UP/DOWN control. The counter we will use can also be loaded in parallel

if PRESET_ENABLE is true. For this project you do not need to know how it is designed, but you need to

know what it does. We will use the counter simply as a way of cycling through all-possible combinations

of sources being off or on, which corresponds to counting from 0 to 15 if UP is enabled. More details on

the counter 4516 chip can be found on the ECE25 website on ece-classweb. Go there and select the

“datasheet and logic board” section from the left side navigation bar. The pins for the counter chip

(CD4516) are shown below.

Logic Analyzer

The logic analyzer is an instrument you may not have seen before. You can think of it as a multi-channel

O-scope for digital signals. It only measures whether the signal is on or off, whereas a scope measures

the analog voltage. The strengths of a logic analyzer are that it can sample many more channels than the

O-scope, and it can trigger on logical combinations of signals. For this project we will treat it simply as an

8-channel scope. Instead of scope probes you have a “pod” with 8 short signal wires and a ground. They

can be connected to the circuit with mini-grabber hooks. Inputs you are not using can be left

unconnected. The pod is connected to the USB port on a computer and the instrument controls are

“virtual” panels on the computer. It is quite intuitive to operate, but you should plan to spend 5 minutes

(4)

Lab Instructions

The goal of this next paragraph is to give you a big picture of what you will be doing in lab. Overall, you

want to have your counter chip’s pins wired appropriately and connected to the ladder network that

you have analyzed. In an effort to make troubleshooting your project easier, it is recommended to build

and test in steps. The first recommended step would be to wire your counter chip following the

instructions under “wiring the counter chip” and then checking that your chip is wired and working

appropriately with a logic analyzer. Once you have confirmed that your chip is working, you should build

the ladder network following the instructions under “building the ladder network” and wire it to your

counter chip. If you are confident in your ability to wire everything appropriately, feel free to set up the

whole project at once—this is only a recommendation to make troubleshooting much easier!

Wiring the Counter Chip

As a general tip, it is good practice to keep the supply off while you are setting up any project in lab;

keep the supply off while you are setting up your counter chip. Connect the function generator to the

clock input (pin 15) and set it to provide a 0 to 5V square wave at a frequency of 10 KHz. We will power

Vdd (pin 16) and UP/DOWN (pin 10) with 5V from the power supply. Ground pins 1, 5, 8, and 9. The P1 –

P4 (pins 3, 4, 12, and 13) will not be used for this project and can be left unconnected. The MSB is Q4

and the LSB is Q1. These pins will connect to your R/2R ladder circuit and will serve as the sources

labeled V0, V1, V2, V3 on the schematic. Keep the layout as clean as possible to simplify your debugging.

Testing the Counter Chip

With the oscilloscope, measure the clock (pin 15), make sure you are able to read the frequency and

pk-pk voltage on the display. Take note of those readings and capture images of the clock (pin 15) in

addition to two of the Q pins of your choice clearly showing the peak to peak voltage and frequency for

your lab report. Take a measurement of the LSB output (Q1, pin 6) with the oscilloscope. The LSB should

switch at half the frequency of the clock, and the pk-pk voltage should be relatively the same– if not

there is an error and you need to find it before continuing. The most common error is that the supply

voltage and ground pins on the CD4516 chip are not connected. Confirm that the voltage on these pins

is correct with the DMM before continuing troubleshooting. Confirm that the remaining outputs

(Q2-Q4) have the same voltage and that the frequency is half the previous.

Now we will use the logic analyzer to check the counter chip. When testing the counter chip, it should

not be connected to the ladder network (we have not built that part of the project yet unless you are

(5)

logic analyzer and display the result on the computer screen. Hook the grey lead of the logic analyzer to

ground, the black lead to the clock, the brown lead to the Q1, the red lead to the Q2, and the orange

lead to Q3, the yellow lead to Q4. If a lead is missing or broken, it is OK to substitute another color lead.

There is a program for the logic analyzer called “Logic”. Find it through the start menu (All Programs --->

SALEAE LLC ---> Logic), or click on the desktop shortcut and open it. When it is opened it should look

similar to the figure on the next page, but will not have the same waveform.

Click the "Start" button. Use your mouse to zoom in and out (right click to zoom out and left click to

zoom in). Adjust the logic analyzer sample interval until you can see a whole cycle of the MSB on the

screen. Make a hard copy of the display. Pin 10 of the counter chip will determine whether the chip will

count from 0 to 15 or from 15 to 0. The chip is told whether to count up or down based on the voltage

applied to that pin—the chip will count up if pin 10 is connected to Vdd and will count down if it is

grounded. Change the up-down control to down by grounding pin 10 of the counter chip and confirm

that it counts down correctly. Make another hard copy of the display.

Have the TA sign you off for the hard copies. Take a picture of your counter chip being tested with the

logic analyzer for your lab report. You have checked that the counter is operating properly and can

(6)

Building the Ladder Network

You will need a total of eleven 100 kΩ resistors. As a recommendation to keep the layout clean, build

the ladder network on a different part of the breadboard and then wire it to the chip. The R/2R ladder

network (R = 50 kΩ) should be built using 100 kΩ resistors. The 50 kΩ resistor can be made with two 100

kΩ resistors in parallel and will be more accurate than an independent 50 kΩ resistor.

Testing the Whole Circuit

Now it is time to bring together the counter chip and ladder network. Wire the circuit appropriately. A

common mistake students make is grounding the ends of the voltage sources. The voltage sources boxed in the schematic below are your counter chip’s pins labeled Q1, Q2, Q3, and Q4. The pins of the counter

chip are used as the voltage sources in the schematic and are all grounded internally by the chip when you

connected pin 8 to ground!

At this point, your chip should be wired to your ladder network.

Now it is time to check that your circuit works in its entirety. Connect channel 1 of the O-scope to the

MSB and channel 2 to your DAC Vanalog output. Press “Auto Set” and you should see Vanalog going

through staircase shape repeatedly. If not, confirm that the resistors of the ladder network are

grounded properly. When it is working correctly make a hard copy for your lab report. Switch the

up-down control and make another hard copy for your lab report. Demonstrate your circuit to the TA and

have your signature sheet signed off.

The DAC should work quite well with a clock frequency of 10 kHz, with Vanalog showing nice square

steps. As you increase the clock frequency the edges of the step will become rounded and eventually, as

you increase the clock frequency, Vanalog will be unable to track input changes and the DAC will

become unusable. But the “roundness” of the steps is too arbitrary. Find the frequency such that the

bottom edge of Vanalog no longer reaches the zero volt line. Clearly our DAC is not usable at that point.

References

Related documents

being of the same type as the ?rst piece but having hooks that are more-or-less at right angles to the hooks of the ?rst piece or being a deep pile or nap so that when the two

Tollway Widening – NTTA – Dallas, Texas - Drilling Coordinator - AGG was the prime geotechnical consultant responsible for subsurface exploration, geotechnical testing and

el ejecutor del tiro toca por segunda vez el balón (excepto con sus manos) antes de que el esférico haya tocado a otro jugador: Ÿ se concederá un tiro libre indirecto al

Inversely, the new roll generations have no or very little eutectic heat generation and the natural hydrodynamic of the process induces defects such as

When one is abusive, when one is hurting so much on the inside that it feels like the only way to make it stop is to hurt other people, it can be terrifying to face the hard truth

és az esetleges szállítási határidőről érdeklődjön üzletünkben, vagy

Year 5 Figure 2.1 Construction project lifecycle 12 Figure 2.2 Risk Management Planning Process 14 Figure 2.3 Probability-impact grid 18 Figure 2.4 Probability and Impacts of Risk

Composing a TOSCA Service Template for a “SugarCRM” Application using Vnomic’s Service Designer, www.vnomic.com. The SugarCRM application include