This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DAC8771: DAC8771 Library in C Language

Part Number: DAC8771

Dear friends

I am starting a project using the IC DAC8771 (Digital-to-Analog Converter). I have had difficulty finding a library in Language C for application with it. My MCU is an ATMEL AVR ATMEGA328P and my Compiler is CodeVisionAVR. Does anyone know of any application note describing the initialization operations of this chip in C language?

I appreciate any help.

Thank you.

Pedro Zuchi

  • Hi Pedro,

    We don't provide specific example code as there are many different MCUs and platforms that can make use of the device. DAC8771 uses a standard SPI which is supported by virtually every MCU/DSP. As for the initialization process, Figure 103 shows a flow chart of the register writes required to configure buck-boost, DAC, and enable the output.

    What may help is creating a header file with the address and register definitions. Here is an example:

    /***********ADDRESS DEFINITIONS************/
    #define NOP 0x0000
    #define RESET 0x0001
    #define RESET_CONFIG 0x002

    /**********REGISTER VALUE DEFINITIONS******/

    #define IDA 0x0800
    #define IDB 0x0400
    #define IDC 0x0200
    #define CLREN 0x0100

    Basically all of the address definitions and register values would be defined to make it easy to write without dealing with hex and binary values every time.

    Using the generic spi write function:
    spi_write(address, value);

    example:
    spi_write(RESET_CONFIG, IDA || IDB || CLREN); //set IDA, IDB, and CLREN bits high by bitwise ORing register definitions

    Let me know if you have additional questions.

    Thanks,
    Garrett