Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
DAC Example 2 for XMEGA-A1 Xplained Documentation

Introduction

This example demonstrates use of the Digital to Analog Converter (DAC) for dual-channel output with automatic refresh.

Main files:

DAC driver API

The DAC driver API can be found here.

Device Info

All AVR XMEGA devices with a DAC can be used.

Description of the example

This example sets up the configured DAC (OUTPUT_DAC) to perform DA conversions on both channels, with output to their respective pins, every time it receives events in event channel 0. Timer/counter 0 on port C is used to generate the events on overflow. This setup gives a constant conversion rate.

The main loop in the example waits for the DAC channels to get ready for new data, then alternately feeds them with values that are 10% and 90% of maximum to demonstrate settling and hold time of the DAC.

Compilation Info

This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.

Contact Information

For further information, visit Microchip.