3.33.4 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

NameDescription
DAC_InitializeInitializes given instance of the DAC peripheral
DAC_DataWriteThis function will write the specified value to the DAC and start the conversion
DAC_IsReadyChecks whether DAC is ready for receiving next sample value