Laboratory Report
Lab 4:  Digital to Analog Converter (DAC)


Digital to analog converters (DACs) are found in many consumer and communication systems. The DAC can be used with a digital signal processor (DSP) to convert a signal into analog for transmission in the mixer circuit, and then to the radio’s power amplifier and transmitter. DACs are used in music players to convert digital data streams into analog audio signals. DACs are also used in televisions and mobile phones to convert digital video data into analog video signals.In this lab, we will interface a DAC to the ATmega328P μC to generate a sawtooth waveform and display the waveform on the Proteus virtual


Design the interfacing circuit between the DAC to the ATmega2560 using SPI (Serial Peripheral Interface)Gain further understanding of SPI

Write a program to interface the DAC to generate a sawtooth waveform

PARTS LISTEquipment:

IBM PC or Compatible with Windows 8 or HigherSoftwareProteus VSM 8.8 from Citrix


In the circuit design, the MCP4921 is the DAC which employs SPI. The MCP1525 provides a 2.5-V precision voltage reference. Unlike in the previous labs 1 to 3, you will NOT use Atmega2560. Instead, you will select Atmega328P when creating the project.

Step 1   Create a new Proteus project called DAC_Lab4.pdsprj. Add the part of schematic diagram in Schematic Capture pane as shown in Figure 1.

3 Figure 1.  Schematic for DAC_Lab4.pdsprj.  Arduino Uno is not shown here.

Step 2   Modify the template of Source Code as shown in Figure 2.

4   Compile the project. Fix the errors that you might have introduced during the code entering. When successful, start the simulation. Notice that you may have to adjust the horizontal and vertical scales to display the saw-tooth waveform.  And, readjust the horizontal time scale to see the SCK, MOSI and SS signals. See figures 4 and

The YELLOW saw-tooth waveform is displayed on the OSCILLOSCOPE. The time scale is too large to see SCK, MOSI and SS. After adjusting Horizontal scale, SCK, MOSI and SS signals are clearly seen. Now, write the report using ECET340_Lab4_Report.docxlocated in Files -> LAB REPORTS. 

Please click on the download link below to get the answer for the above tutorial:

Leave a Comment