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 board |
sam_v71_xult.X | MPLABX Project for SAM V71 Xplained Ultra board |
Setting up the hardware
The following table shows the target hardware for the application projects.
Project Name | Board |
---|---|
sam_e70_xult.X | SAM E70 Xplained Ultra board |
sam_v71_xult.X | SAM V71 Xplained Ultra board |
Setting up SAM E70 Xplained Ultra board
- 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 board
- 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
- Build and Program the application using its IDE
- Observe a sine wave on DACC output pin
Board | DACC output pin |
---|---|
SAM E70 Xplained Ultra board | PB13 (Pin 5 of J502 connector) |
SAM V71 Xplained Ultra board | PB13 (Pin 5 of J504 connector) |