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: IDE compatibility

Part Number: DAC81416EVM
Other Parts Discussed in Thread: DAC81416

Good Morning, 

This might be a very generic question, but I was wondering if it would be possible to program DAC81416 from the eval module using the Arduino IDE and their built-in SPI library. 

Thank You

  • Hi Dave,

    Yes, any SPI interface should work.  You just need to connect it.

    Thanks,

    Paul

  • Hi Dave,

    Did you need more help with this?

  • Hi Paul,

    Thanks for reaching out!

    I’m afraid I’m having a couple of issues with establishing communication with the evaluation module. The device does not respond to any of the SPI commands sent by the controller and seems to remain in the power-down mode ( the output pins remain consistently grounded). I am not exactly sure if my problem is related to hardware or software.

    I am using an Arduino to program the device, the following is one of the codes I've attempted to use:

    #define DATAOUT 11//MOSI
    #define DATAIN 12//MISO
    #define SPICLOCK 13//sck
    #define SLAVESELECT 10//ss
    byte clr;
    uint8_t address;

    char spi_transfer(volatile char data)
    {
    SPDR = data; // Start the transmission
    while (!(SPSR & (1<<SPIF))) // Wait for the end of the transmission
    {
    };
    return SPDR; // return the received byte
    }


    void setup() {
    pinMode(DATAOUT, OUTPUT);
    pinMode(DATAIN, INPUT_PULLUP);
    pinMode(SPICLOCK,OUTPUT);
    pinMode(SLAVESELECT,OUTPUT);
    digitalWrite(SLAVESELECT,HIGH);
    SPCR |= (1 << MSTR); //set as master
    SPCR |= (1 << SPE); //enable spi
    SPCR |= (1 << CPHA); //mode 1
    clr=SPSR;
    clr=SPDR;
    delay(10);

    digitalWrite(SLAVESELECT,LOW);
    spi_transfer((char)(0x03)); //power up device
    spi_transfer((char)(0x0A));
    spi_transfer((char)(0x84));
    digitalWrite(SLAVESELECT,HIGH);
    delay(10);

    digitalWrite(SLAVESELECT,LOW);
    spi_transfer((char)(0x09)); //power every channel
    spi_transfer((char)(0x00));
    spi_transfer((char)(0x00));
    digitalWrite(SLAVESELECT,HIGH);
    delay(10);

    digitalWrite(SLAVESELECT,LOW);
    spi_transfer((char)(0x05)); //enable broadcast
    spi_transfer((char)(0xFF));
    spi_transfer((char)(0xFF));
    digitalWrite(SLAVESELECT,HIGH);
    delay(10);

    }

    void loop() {
    // put your main code here, to run repeatedly:


    digitalWrite(SLAVESELECT,LOW);
    spi_transfer((char)(0x0F)); //write half-range V
    spi_transfer((char)(0x7F));
    spi_transfer((char)(0xFF));//write enable
    digitalWrite(SLAVESELECT,HIGH);
    delay(100);

    digitalWrite(SLAVESELECT,LOW);
    spi_transfer((char)(0x0F)); //write full-range V
    spi_transfer((char)(0xFF));
    spi_transfer((char)(0xFF));//write enable
    digitalWrite(SLAVESELECT,HIGH);
    delay(100);
    }

    My hardware connections are the following: 

    For the power supply header:

    GND from power supply at J7.3

    5V (from Arduino) at J7.4

    5V from power supply at J7.5

    GND at J7.6

    9V from power supply at J7.7

    For the digital connections at J8:

    Arduino pin 10 (CS) at J8.2

    Arduino pin 12 (MISO) at J8.3

    pin 11 (MOSI) at J8.4

    5V from Arduino  at J8.5

    GND at J8.6

    5V (LDAC) at J8.7

    pin 13 (CKL) at J8.8

    the TOGGLE test points are tied to ground

    My jumper configuration is the following: 

    J2 J3 open

    J9 closed

    J10 2-3 (external VIO)

    J11 1-2 (on-board VREF)

    J12 1-2 (GND as VSS)

    I would really appreciate if you could give me some advice on resolving my issue.

    Dave

  • Hi Dave,

    could you use an oscilloscope or digital analyzer to capture an SPI transaction? Usually, these issues are caused by wiring issues or misformatted SPI frames.