1.3.6 Digital-to-Analog Converter (DAC)

The Digital-to-Analog Converter (DAC) converts a digital value to a voltage. The DAC has one channel with 10-bit resolution, and it is capable of converting up to 350,000 samples per second (350ksps).

Using The Library

The DAC peripheral library provides an interface for the conversion of digital values to analog voltage.

The user must ensure that new data is not written to the DAC before the last conversion is complete as illustrated below.

// Write new data if DAC is ready
 if (DACC_IsReady())
 {
    DACC_DataWrite (0xff)
 }

Library Interface

Digital Analog Converter peripheral library provides the following interfaces:

Functions

Name Description
DAC_Initialize Initializes given instance of the DAC peripheral
DAC_DataWrite This function will write the specified value to the DAC and start the conversion
DAC_IsReady Checks whether DAC is ready for receiving next sample value