1.41.4 Digital-to-Analog Converter Controller (DACC)

The Digital-to-Analog Converter Controller (DACC) peripheral provides the following features:

  • Up to three independent Analog Outputs

  • 12-bit resolution

  • Free-running mode and Hardware Trigger

Using The Library

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

The DAC can operate in free-running mode, where a write to the conversion-data register initiates an update on the analog output, or in triggered mode, where updates are initiated by a rising edge on an \internal or external synchronization signal.

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 */
    bool status = false;
    DACC_ChannelSelect(DACC_CHANNEL_0);
    if (true == DACC_IsReady())
    {
       DACC_DataWrite (0xff);
    }
    else
    {
       //DACC is not ready to accept new conversion request
       //User Application code
    }

Library Interface

Digital-to-Analog Converter Controller peripheral library provides the following interfaces:

Functions

Name Description
DACC_Initialize Initializes DACC module of the device
DACC_IsReady Returns the status of readiness of DACC module for new conversion request
DACC_ChannelDataWrite Converts a Digital data to Analog value
DACC_ChannelSelect Select the channel of DACC module for new conversion request
DACC_DataWrite Converts a Digital data to Analog value

Data types and constants

Name Type Description
DACC_CHANNEL_NUM Enum Identifies the Channel index of DACC module