Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
DAC Sinewave Example

Purpose

The DAC Sinewave example demonstrates how to use DACC peripheral.

Requirements

This example can be used on any SAM3/4/V71/E70 boards.

Description

This application is aimed to demonstrate how to use DACC in free running mode.

The example allows to configure the frequency and amplitude of output sinewave. The frequency could be set from 200Hz to 3KHz, and the peak amplitude could be set from 100 to 1023/4095 in regard to 10/12bit resolution.

The example can also generate a full amplitude square wave for reference.

The output could be monitored by connecting the following PIN that is used to one channel of an oscilloscope.

  • PB13

Usage

  1. Build the program and download it into the evaluation board.
  2. On the computer, open and configure a terminal application (e.g., HyperTerminal on Microsoft Windows) with these settings:
    • 115200 bauds
    • 8 bits of data
    • No parity
    • 1 stop bit
    • No flow control
  3. In the terminal window, the following text should appear (values depend on the board and chip used):
    -- DAC Sinewave Example xxx --
    -- xxxxxx-xx
    -- Compiled: xxx xx xxxx xx:xx:xx --
    -- Menu Choices for this example--
    -- 0: Set frequency(200Hz-3kHz).--
    -- 1: Set amplitude(100-4095).--
    -- i: Display present frequency and amplitude.--
    -- m: Display this menu.--
  4. Input command according to the menu.