Jump to main content

##

# 1.8 DACC Waveform Generation with DMA

This example shows how to use the DAC with the DMA to generate sinusoidal waveform without CPU intervention.

## Description

The DACC Peripheral library is used in hardware trigger mode to generate a Sine wave. On every Timer Counter (TC) Interrupt, the DACC converts the digital data to analog data by reading it from memory using XDMAC.

## Downloading and Building the Application

To clone or download this application from Github, go to the main page of this repository and then click Clone button to clone this repository or download as zip file. This content can also be downloaded using content manager by following these instructions.

Path of the application within the repository is apps/dacc/dacc_wav_gen_dma/firmware.

To build the application, refer to the following table and open the project using its IDE.

Project Name | Description
--- | ---
sam_e70_xult.X | MPLABX project for SAM E70 Xplained Ultra Evaluation Kit
sam_v71_xult.X | MPLABX project for SAM V71 Xplained Ultra Evaluation Kit

## Setting Up the Hardware

The following table shows the target hardware for the application projects.

Project Name | Description
--- | ---
sam_e70_xult.X | SAM E70 Xplained Ultra Evaluation Kit
sam_v71_xult.X | SAM V71 Xplained Ultra Evaluation Kit

### Setting Up SAM E70 Xplained Ultra Evaluation Kit

- Connect DACC Channel 0 output pin to oscilloscope probe for observing the analog output waveform
  - DACC Channel 0 is available through PB13 (Pin 5 of the J502 connector)
- Connect the Debug USB port on the board to the computer using a micro USB cable

### Setting Up SAM V71 Xplained Ultra Evaluation Kit

- Connect DACC Channel 0 output pin to oscilloscope probe for observing the analog output waveform
  - DACC Channel 0 is available through PB13 (Pin 5 of the J504 connector)
- Connect the Debug USB port on the board to the computer using a micro USB cable

## Running the Application

1. Build and Program the application using its IDE
2. Observe a sine wave on DACC output pin

   Board | DACC Output Pin
   --- | ---
   SAM E70 Xplained Ultra Evaluation Kit | PB13 (Pin 5 of J502 connector)
   SAM V71 Xplained Ultra Evaluation Kit | PB13 (Pin 5 of J504 connector)