Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

DAC81416EVM: Programming method for Arduino.

Part Number: DAC81416EVM

Hello,

I'm trying to program the DAC81416EVM using SPI interface of Arduino Uno. The setting is like blew. 

GND -> J7.3

3.3V from Arduino -> J7.4

5V from power supply -> J7.5

20V from power supply -> J7.7

...

I'm just trying to control the DAC81416 using Arduino but it is not working. If there is someone else who knows how to program it. I hope you let me know the detailed method for programming. Also, I hope you show me a certain example of working code that I can refer to. I'm hard working but I think it is not my field. Please give me your help.

  • Hello,

    Can you please give more details about your setup? I found this diagram if the Uno with the SPI signals labeled. Is this correct? 

    If so, it doesn't look like you have the correct SPI pins connected to the J8 connector of the DAC81416EVM:

    Can you verify that your connections are correct?

    We do not have Arduino example code, but you can search for Arduino SPI libraries. You will need a 24-bit SPI frame that captures data on the falling edge to communicate with the DAC81416. I can help you figure out the DAC register settings you need to configure for your application.

    Best,

    Katlynne Jones 

  • You are so awesome!

    Thank to you, I founded that I connected incorrectly and I fixed it. 

    GND -> J8.6

    Arduino 13 -> J8.8

    Arduino 12 -> J8.3

    Arduino 11 -> J8.4

    Arduino 10 -> J8.2       // Is there any other incorrect connection?

     

    I checked the SPI library already but cannot exactly understand what it is saying. If you don't have Arduino example code, can you share any kinds of example code that makes the DAC81416EVM work? I'm sure that that will improve my process so much. Or I hope you let me know the whole necessary steps for programming the DAC81416EVM? Thank you so much for your reply.

  • Hello,

    Your connections look correct now. I do not have any example code for this device, but I can give you some pseudocode for the DAC register settings. The library SPI library likely has a write and a read function. You need to write a total of 24 bits. 8-bits for the register address and 16-bits for the register data. Refer to the register map in the datasheet to know how to modify the settings from what I have set below. I just used some example settings to get the EVM up and running. The format is write(address, data):

    • write(0x03, 0x0004) //enable SDO for SPI read
    • write(0x04, 0x4000) //disables internal reference (default). Enable by writing 0x00 (remove jumper J11 on EVM). Disables differential mode
    • write(0x09, 0xFFFF) //Powers up all DAC outputs
    • write(0x0A, 0x0000) //Sets all DAC ranges to 0 to 5V (default).
    • write(0x0B, 0x0000) //Sets all DAC ranges to 0 to 5V (default).
    • write(0x0C, 0x0000) //Sets all DAC ranges to 0 to 5V (default).
    • write(0x0D, 0x0000) //Sets all DAC ranges to 0 to 5V (default).
    • write(0x10, 0x8000) //Writes to the DAC-DATA0 register
    • ...
    • write(0x1F, 0x8000) //Writes to the DAC-DATA15 register

    You'll also need to set the SPI clock speed to be appropriate for the DAC81416, and also set the appropriate SPI mode. The SPI mode should be set so the MOSI is shifted out on a rising edge and captured on the falling edge. 

    I have seen another user use the following library for the DAC81404: https://github.com/sphCow/DAC81404_lib

    This is also a DAC that requires a 24-bit SPI frame. It looks like they have written a dac_write function that uses 3 8-bit SPI writes to write the 8-bit address, and splits the 16-bit data into a 8-bit msb and 8-bit lsb. This project is good example of the steps necessary to write to the DAC. 

    You could use something similar and also modify the header file to use the DAC81416 register names. There might be a similar DAC81416 Arduino library already out there as well. 

    Best,

    Katlynne Jones