CP/PC364 Data Communications & Networks Laboratory
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:
- to learn how to use the Arduino SPI interface
- to connect the SPI D/A IC for proper operation
- to write a test sketch to show the SPI D/A in operation
BackgroundThe 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.
- bench supply, oscilloscope
- breadboard, debugger board, resistors, capacitors
- MAX522 [PDF: 12 pages], SPI digital-to-analog converter
TaskTo wire the DAC, there are 3 different sub-circuits to wire. They are:
- Voltage reference
- Supply voltages and inputs from Arduino
- Conect the REF input of the DAC to the supply voltage. The output voltage will be proportional to the voltage on the REF input.
- Conect the Arduino according to the Arduino
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.
- Conect the output from one of the DACs to the oscilloscope to see the output.
- Write a sketch to send values to the DAC. Note that every
transfer to the DAC should be a two byte transfer.
Hint: Start with the DigitalPotControl sketch, as it is very similar to what you need.
done everything correctly, you should have a circuit which can
take in an
8-bit digital value and produce an appropriate analog output
between 0 and 5 volts.
Demonstrate your circuit to the lab supervisor.