CP/PC364 Data Communications & Networks Laboratory

D/A Conversion


Digital transmission of analog data, (such as sound and video), requires analog input signals to be converted to digital signals for processing. Once received, the signals then have to be converted to back analog. These conversions are done by analog to digital (A/D) and digital to analog (D/A) converters, respectively. Although you could construct these converters from discrete components, integrated circuits specifically designed for these purposes are usually used.


The objectives for this lab are:


The SPI (Serial Peripheral Interface) bus is a synchronous interface allowing a single master device to communicate with multiple slave devices. The master device controls a clock signal for the slaves. The bus consists of two data lines (one for each direction), the clock signal, and select lines for each slave. Although it may not always be mentioned, it's also important that the GROUND lines for the master and slaves be connted. It is now very commonly used to connect sensors to microprocessors or microcontrollers, and so will remain relevant for the forseable future. It's also one of the simplest serial protocols, and so it's easy to study. The Arduino board has an SPI bus built-in to handle up to two slave devices, so it can be used to study SPI communications.
Note: The Arduino sketches using SPI use pin 10 for the slave select. Since the LCD shield uses pin 10 for the backlight control, you will have to change the sketch to use a different (otherwise unused) pin for the slave select.



To wire the DAC, there are 3 different sub-circuits to wire. They are: You will wire each of these sections in turn.
  1. Conect the REF input of the DAC to the supply voltage. The output voltage will be proportional to the voltage on the REF input.
  2. Conect the Arduino according to the Arduino documentation.
    Since communication is only going from the Arduino to the DAC, which signal line do you need?
    Remember to connect the SPI clock and GROUND lines as well.
    How many slave select lines does the Arduino have? Be sure your sketch is correct for the one you choose.
  3. Note: The two DACs have different current limits, so the capacitor required depends on which one you're using. See the datasheet for details.
    Connect either the 0.1 μ F capacitor or the 0.01 μ F capacitor from the output of the DAC to GROUND, depending on which DAC you are using.
  4. Conect the output from one of the DACs to the oscilloscope to see the output.
  5. Start with the Max522DACControl sketch.
    As it says in the sketch, you will need to change the pin used for the chip select, since the default pin is used by the LCD shield.
  6. If you have done everything correctly, you should have a circuit which produces a sawtooth waveform between 0 and 5 volts.
  7. Now modify your sketch to take in a number between 0 and 255 from the serial monitor, display it on the LCD, and output it to the DAC.
  8. Since there are three signals involved in the SPI communication, but the oscilloscope only has two channels, showing all three signals together takes a bit of work.
    Connect the SPI clock and data lines to the oscilloscope. Capture a trace showing the activity on both lines for comunication between the Arduino and the DAC. You will need this for the postlab.
  9. Now disconnect the SPI data line from the oscilloscope, and connect the chip select instead. Capture a trace showing the activity on both lines for comunication between the Arduino and the DAC. You will need this for the postlab.

    Demonstrate your circuit to the lab supervisor.

Do not dismantle the D/A circuit. Store this circuit in your lockup area for use later.


To view pdf documents, you can download Adobe Acrobat Reader .
get Acrobat Reader
If you need to update a browser, you might try Firefox which is Get Firefox!
Since this page uses cascading style sheets for its layout, it will look best with a browser which supports the specifications as fully as possible.

If you are looking for an office package, with a word processor, spreadsheet, etc., you might try LibreOffice which is Get LibreOffice!

Go to the main page for the Department of Physics and Computer Science.

Valid XHTML 1.1

Valid CSS!

(Level AA)

Wilfrid Laurier University