XMega DAC

Summary of XMega DAC


This article discusses using the internal 12-bit Digital-to-Analog Converter (DAC) in ATXmega microcontrollers, specifically the ATXmega32A4U, to generate analog outputs like audio and waveforms. It highlights the DAC's versatility compared to external solutions, noting its ability to interface with DMA, event systems, and provide reference sources for ADCs and comparators. The device supports both internal (1.0V) and external voltage references to drive resistive or capacitive loads.

Parts used in the XMega DAC Project:

  • ATXmega32A4U Microcontroller
  • Dual Channel DACB Block
  • Internal 1.0V Reference
  • External AVCC Reference
  • External AVREF Reference
  • Analog Comparator Block
  • ADC Block
  • DMA Interface
  • Event System Interface
  • Resistive Loads
  • Capacitive Loads

In embedded systems, oftentimes it is needed to generate analog outputs from a microcontroller. Examples of such include, generating audio tones, voice, music, smooth continuous waveforms, function generators, voltage reference generators, etc. Traditionally in such cases the most common techniques applied are based on Pulse Width Modulation (PWM), resistor networks and external Digital-to-Analog Converter (DAC) chips like MCP4921. The aforementioned techniques have different individual limitations and moreover require external hardware interfacing, adding complexities and extra cost to projects.  XMega micros are equipped with 12 bit fast DACs apart from PWM blocks and again it proves itself to be a very versatile family of microcontrollers. In this post we will have a look into this block.

A brief overview

I used ATXMega32A4U just as always and it has only one dual channel DAC designated DACB but there are other XMega devices that have more than one DAC.

The internal block diagram of the DAC block above shows its major parts. The DAC of XMega is perhaps one of the simplest block to understand. Apart from DMA and event system interfacing, the DAC can provide reference source for the analog comparator and ADC blocks. It also has the capability to directly drive both resistive and capacitive loads (check device datasheet for limits). Just like the ADC block, the DAC block itself needs a reference source and this reference source can be both internal (internal 1.0V reference) and external (AVCC or AVREF). As stated earlier there are two independent DAC channels in the XMega32A4U and so there are two separate analog outputs (PB2 and PB3) available from this micro.

The basic formula for voltage output from the DAC is as follows:

For more Details: XMega DAC

Quick Solutions to Questions related to XMega DAC Project:

  • What is the primary purpose of the XMega DAC block described?
    To generate analog outputs such as audio tones, voice, music, and smooth continuous waveforms from a microcontroller.
  • How many independent DAC channels does the ATXmega32A4U have?
    The ATXmega32A4U has two independent DAC channels designated as DACB.
  • Can the XMega DAC drive capacitive loads?
    Yes, the DAC block has the capability to directly drive both resistive and capacitive loads within device limits.
  • What reference sources are available for the XMega DAC?
    The DAC can use an internal 1.0V reference or external references like AVCC or AVREF.
  • Does the XMega DAC support interfacing with other system blocks?
    Yes, it supports DMA and event system interfacing and can provide a reference source for analog comparator and ADC blocks.
  • What are the analog output pins for the dual channel DAC on the ATXmega32A4U?
    The two separate analog outputs are available on pins PB2 and PB3.
  • Why might one choose the internal DAC over external chips like MCP4921?
    Using the internal DAC avoids the complexities and extra costs associated with external hardware interfacing required by traditional techniques.
  • Is the DAC resolution mentioned in the article fixed at 12 bits?
    Yes, the article states that Xmega micros are equipped with 12 bit fast DACs.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top