3.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

NameDescription
DACC_InitializeInitializes DACC module of the device
DACC_IsReadyReturns the status of readiness of DACC module for new conversion request
DACC_ChannelDataWriteConverts a Digital data to Analog value
DACC_ChannelSelectSelect the channel of DACC module for new conversion request
DACC_DataWriteConverts a Digital data to Analog value

Data types and constants

NameTypeDescription
DACC_CHANNEL_NUMEnumIdentifies the Channel index of DACC module