RETURN to the CHEM 498C Home Page

Digital-To-Analog Conversion

Equipment needed: IBM-PC, PCL-812 analog data acquisition/control board, digital volt meter.

1. Install the PCL-812 board into any available slot of the IBM-PCs bus. The base address A is determined by the base address switch on the board; the factory default is hex 220 (544 decimal).

The PCL-812 board has two separate DACs with 12 bit resolution and an output range of 0 to 5 volts. They expect to receive 12-bit integer (0-4095) from the computer. Because the OUT command handles only 8 bits at a time, it is necessary that each DAC use two addresses, one for the least significant byte (LSB, the lowest 8 bits) and one for the most significant byte (MSB, consisting of only 4 bits in this case). DAC #1 uses the address A+4 for LSB and A+5 for MSB; its output is available at pin 13 on output connector 2. DAC #2 uses the address A+6 for LSB and A+7 for MSB; its output is available at pin 15 on output connector 2 (CN2) that is accessible from the back of the computer. Therefore we must "split up" a 12-bit integer into two 8-bit parts, MSB% and LSB%, before we can output it to the DACs. If D is the 12-bit data (an integer between 0 and 4095) the MSB and LSB are given by:

MSB% = D \  256
LSB% = D - (256 * MSB%)

To output this to DAC #1, for example, you would do an OUT A+4, LSB% followed by an OUT A+5, MSB%. Note that the order in which the bytes is OUTput is significant; you must output the LSB first. The output voltage changes as soon as the data are OUTput, it is not necessary to issue a "begin conversion" command as is the case with analog-to-digital converters.

2. Write a program which prompts the user to select DAC 1 or 2 and then enter an integer between 0 and 4095 and outputs that number to the specified DAC.

3. Connect a digital voltmeter to the output of DAC #1 (pin 13 on CN2). Use your program to OUTput numbers from 0 to 4095 into that DAC and note the effect on the output voltage. What is the functional relationship between the integer data and the voltage? Modify your program so that it prompts the user for a voltage (between 0 and 5 volts) and then sets the output of the DAC as close as possible to that voltage. Check your program for accuracy vs the digital volt meter for several voltages in the 0 to 5 volt range.

4. Write a program that uses the internal TIMER functions and the DAC to generate a linear ramp voltage at a user-specified rate (in volts/sec) between any specified starting and ending voltage within the 0 - 5 volt range of the DAC. (The program should be capable of generating ramps from lower to higher voltages and from higher to lower voltages).


Lab report: Submit your program on disk for #4 only.


This page is maintained by Tom O'Haver , Department of Chemistry and Biochemistry, The University of Maryland at College Park. Comments, suggestions and questions should be directed to Prof. O'Haver at to2@umail.umd.edu.