Purpose
This example demonstrates how to configure and use DMAC controller for single and multiple memory to memory data buffer transfers.
Requirements
This example can be used with SAM evaluation kits that have a DMA Controller.
Description
This example transfers data in one RAM buffer to another RAM buffer. Two transfer modes will be used:
- It uses single buffer transfer with polling mode. After transfer is done, the transferred data will be verified.
- It uses multiple buffer transfer with interrupt mode. After transfer is done, the transferred data will be verified.
Main Files
- dmac.c: Direct Memory Access Controller driver
- dmac.h: Direct Memory Access Controller driver header file
- dmac_example1.c: Direct Memory Access Controller example application
Compilation Information
This software is written for GNU GCC and IAR Embedded Workbench® for Atmel®. Other compilers may or may not work.
Usage
- Build the program and download it into the evaluation board.
- On the computer, open and configure a terminal application (e.g., HyperTerminal on Microsoft® Windows®) with these settings:
- 115200 baud
- 8 bits of data
- No parity
- 1 stop bit
- No flow control
- Start the application.
- In the terminal window, the following text should appear:
* -- DMAC Example --
* -- xxxxxx-xx
* -- Compiled: xxx xx xxxx xx:xx:xx --
*
* Test single buffer transfer......
* > Test OK
*
* Test multiple buffer transfer......
* > Test OK.
- Note
- Values depend on the board and the chip used.