Important Note Concerning Equipment

Total Page:16

File Type:pdf, Size:1020Kb

Important Note Concerning Equipment

EE 314 Spring 2000 Microprocessor Systems

Laboratory Project #6

Parallel Printer Port Use and Digital-to-Analog Conversion

February 28 to March 10, 2000

Important Note Concerning Equipment.

This is the first lab that has required the use of hardware external to the PC. Most of the external hardware will be provided. You must work in a group of two for this laboratory. Each group of two will require one of the following sets of equipment (either option A or B)

Option A  18 2x Resistors and 14 1X resistors (Provided)  1 Digilab Board (latest revision)  1 Program ROM for the Digilab Board (Must be checked out and returned at the end of this two-week lab).

Option B  18 2x Resitors and 14 1x resistors (Provided)  Use a Digilab Board Provided this may NOT be removed from EE/ME 136  1 Program ROM for the Digilab Board (Must be checked out and returned at the end of this two-week lab).  Your own Breadboard

To complete this lab you will have to build 2 R2R ladders to perform D/A conversion on a Breadboard. If you supply your own Digilab board (Option A) you can build this on the provided Breadboard. However, if you choose to use the provided boards, you must build the R2R ladders on your own breadboard.

The 1x, 2x resistors refers to the ratio between the resistors. One example is 11K Ohm and 22K Ohm. Note that these values may not be the value of the resistors you use in this lab. Clint: Put info here on obtaining a Digilab board.

Overview and Introduction

In this 2-week laboratory assignment you will be constructing a circuit that will interface to the PC through the printer port. The circuit will implement a simple two-channel D/A converter. The first part of the problem is to construct and test the D/A converter. The second part will be to use this converter to display various patterns on an oscilloscope.

Objectives Goals for this lab are: (1) Understand how to use the printer port hardware interface. (2) Understand how an R-2R ladder works for D/A conversion. (3) Write a program which uses both C/C++ and Assembly language to interface to hardware.

Pre - Lab

(Due at the beginning of the first lab period.)

1. Review the detailed schematic for a simple two-channel D/A converter (attached, appendix A). Note how the converter is controlled by the standard printer port. Also review the given printer port organization. What values need to be output to the printer port registers to load data into each set of registers (the X and Y channels) ? You will need to find more information on parallel port usage. One good source is "Interfacing to the IBM-PC Parallel Printer Port" at http://www.doc.ic.ac.uk/~ih/doc/par. You can find many more such documents by searching the web.

2. Write a program in Turbo C++ (provided on all the lab machines in EEME 136) that uses the provided pputils.cpp and pputils.h to:  Locate the location of the parallel port registers.  Print the location of these registers to screen (Base Address, Control Address, and Data Address)  Drive all Data pins low (Verify this with a multimeter or an oscilloscope). Use the zipped project posted to the web-site to get started.

3. Determine what the output voltage is on the R2R ladder in Figure 1 if the value of the inputs are: D7 D6 D5 D4 D3 D2 D1 D0 1 0 0 0 1 0 0 0 Vdd = 5volts (Hint: use superposition)

Figure 1 20K D7 Output 20K 10K D6 10K 20K D5 10K 20K D4 10K 20K D3

20K 10K D2

20K 10K D1 10K 20K D0 20K Lab Procedure

1. Construct your hardware. Check it carefully before connecting it to the printer port. A misconnection WILL burn a component.

2. Test both channels of the D/A converter. Plot the linearity of the converters.

3. Derive a way to drive the binary D/A converter with 2’s complement numbers. This should be done totally in software.

4. Write a program to drive the two channels simultaneously. The program is to “draw” Lissajous figures on the screen of the oscilloscope. You should be able to select any of the following figures: 45 deg line, circle, vertical figure 8, sidewise figure 8. (To draw a circle plot y =sin(t), x=cos(t) to draw a figure eight plot y=sin(2t) versus x=cos(t))

5. Extend your program from the previous problem to allow the Lissajous figures to "rotate" at varying rates in space. This is done by varying the phase angle of one of the sine signals.

Demonstrate your programs by the end of the second lab period.

Extra Credit

Develop a program that will draw an arbitrary figure on the oscilloscope. Demonstrate it using a figure of your choice, for example, your initials or a favorite cartoon character.

Lab report

The report is due at the start of the lab period following the second week. Include all programs in the report and observe the required format. Appendix A.

The control signals used from the parallel port are summarized in the table below:

Data7 - Data0 Data for both X and Y channel Autofd Clocks the X channel Init Clear for both channels Strobe Clocks the Y Channel The truth table for the component FDC can be found at http://toolbox.xilinx.com/docsan/2_1i/data/common/lib/lib5_8.htm. It has also been reproduced here:

Inputs Output CLR D C Q 1 X X 0 0 1  1 0 0  0

Recommended publications