EE314 – Microprocessor Systems
Laboratory Project 07
Parallel Printer port use and Digital-to-Analog Conversion
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.
Goals for this lab are:
NOTE: You will be required to furnish your own protoboard. One set of components will be provided for each pair of students.
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). 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 of the 74LS273 registers?
2. Write a program in C with inline assembly statements to test the parallel port and D/A converters. The following output functions demonstrate the use of inline assembly for sending data to an arbitrary I/O port.
#define ubyte unsigned char
#define byte char
#define uword unsigned int
#define word int
void OutPortByte( uword IOAddress, ubyte Value )
{
_DX = IOAddress;
_AL = Value;
asm out dx,al;
}
void OutPortWord( uword IOAddress, uword Value )
{
_DX = IOAddress;
_AX = Value;
asm out dx,ax;
}
Of specific interest is to determine how linear each converter channel is. A simple way to test DAC linearity is to repeatedly scan through all possible values (from 0 to 255) and observe how "straight" the waveform is on the oscilloscope.
Laboratory Procedure
Demonstrate your programs by the end of the second lab period. 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.
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.
Appendix – Printer Port Configuration and D/A Converter Schematic
Data Port (378 H)
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
data 7 |
data 6 |
data 5 |
data 4 |
data 3 |
data 2 |
data 1 |
data 0 |
Control Port (37A H)
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
init |
autfd |
strb |