Post Go back to editing

New AD524R is not working

Category: Hardware
Product Number: AD5624R

I recently bought and tried using the AD5624R with an Arduino Duemilanove board.

I make sure I supply Vdd and Vref with 3.3V DC and I supply my circuit with 12V DC.

For ground I use the ground of my DC Transformer.

For the SPI I connected Pin6 of the DAC with the SS, Pin7 with SCLK and Pin8 with MOSI.

I uploaded the four sine wave example code and I got no results on the outputs. I measured directly on the output and ground.

Am I doing something wrong? Is an opamp necessary for the measurements?

Is my DAC broken?

Can you please give me any suggestion?

Thank you in advance!

Parents
  • Hi  

    What exact model of the AD5624 did you buy? Are you using it with our evaluation board? Can you give a diagram of how your setup looks like?

    Supplies are within limits and the SPI connections are correct. What is the example code that you used? Can you please share it. 

    There is no need for an opamp as this DAC has buffered output and should output voltages directly, given the correct code written to it. 

    Best regards,

    Ian

  • The model I am using is AD5624R-BRMZ-REEL7. Below I will attach the diagram of the setup so far.

    The example i used is Four Sine Waves.

    /* Copyright (c) 2013, Freja Nordsiek
       All rights reserved.
       
       Redistribution and use in source and binary forms, with or
       without modification, are permitted provided that the
       following conditions are met:
       
       1. Redistributions of source code must retain the above
       copyright notice, this list of conditions and the following disclaimer.
       
       2. Redistributions in binary form must reproduce the above
       copyright notice, this list of conditions and the following
       disclaimer in the documentation and/or other materials
       provided with the distribution.
       
       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
       CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
       INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
       MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
       DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
       CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
       SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
       LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
       HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
       CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
       OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
       SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
    
    /* Analog Sine Waves
       
       This example controls an Analog Devices AD56X4 Quad Channel DAC
       (Digital to Analog Converter) by SPI and writes a 10 Hz sine
       wave to each channel that are all 90 degrees out of phase. The
       outputs are updated synchronously.
       
       Author:   Freja Nordsiek
       Notes:
       History:  * 2013-08-17 Created.
    */
    
    #include "Arduino.h"
    #include "math.h"
    #include <SPI.h>
    #include <AD56X4.h>
    
    // Output pin for the Slave Select SPI line of the AD56X4.
    
    int AD56X4_SS_pin = 10;
    
    // Define the sine wave frequencies for each channel in Hz, the
    // initial phases in degrees, the offsets, and the amplitudes.
    
    float frequencies[] = {1e1, 1e1, 1e1, 1e1};
    float phases[] = {0, 90, 180, 270};
    float offsets[] = {32768, 32768, 32768, 32768};
    float amplitudes[] = {32600, 32600, 32600, 32600};
    
    void setup()
    {
      
      // Setup SPI. This means setting pin 10 to output (arduino must
      // be the master), the AD56X4 Slave Select pin to output, the
      // SPI clock (chip's 50 MHz is way faster than our 8 MHz max),
      // and start SPI.
      
      pinMode(10,OUTPUT);
      pinMode(AD56X4_SS_pin,OUTPUT);
      SPI.setClockDivider(SPI_CLOCK_DIV2);
      SPI.begin();
      
      // Reset the AD56X4, which will power it up and set all outputs
      // to zero.
      
      AD56X4.reset(AD56X4_SS_pin,true);
      
      
    }
    
    void loop()
    {
      
      // Get the current time.
      
      float t = 1e-6 * float(micros());
      
      // Array to help in giving the library the right channel.
      
      byte channels[] = {AD56X4_CHANNEL_A, AD56X4_CHANNEL_B,
                         AD56X4_CHANNEL_C, AD56X4_CHANNEL_D};
      
      // Calculate the sine wave and put it in the input register for
      // each channel (not output by the DAC yet).
      
      for (int i = 0; i < 4; i++)
        {
          
          // Calculate the sine wave value.
          
          float y = offsets[i] + amplitudes[i]
                    * sin(2.0*M_PI*(t*frequencies[i] + phases[i]/360.0));
          //y = 0xAAAA ; //I switched to something constant just in case
          // Convert to a word (unsigned int) making sure to keep it
          // in the range [0, 0xFFFF].
          
          word output = word(y);
          
          if (y > 0xFFFF)
            output = 0xFFFF;
          else if (y < 0)
            output = 0;
            
          // Write the output to the i'th channel making sure that only
          // the input register is set (not output yet).
            
          AD56X4.setChannel(AD56X4_SS_pin, AD56X4_SETMODE_INPUT,
                            channels[i], output);
          
        }
      
      // Update all the DAC registers so that the outputs of the DAC
      // are now the new sine wave values. This is synchronous.
      
      AD56X4.updateChannel(AD56X4_SS_pin, AD56X4_CHANNEL_ALL);
      
    }
    

Reply
  • The model I am using is AD5624R-BRMZ-REEL7. Below I will attach the diagram of the setup so far.

    The example i used is Four Sine Waves.

    /* Copyright (c) 2013, Freja Nordsiek
       All rights reserved.
       
       Redistribution and use in source and binary forms, with or
       without modification, are permitted provided that the
       following conditions are met:
       
       1. Redistributions of source code must retain the above
       copyright notice, this list of conditions and the following disclaimer.
       
       2. Redistributions in binary form must reproduce the above
       copyright notice, this list of conditions and the following
       disclaimer in the documentation and/or other materials
       provided with the distribution.
       
       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
       CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
       INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
       MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
       DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
       CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
       SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
       LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
       HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
       CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
       OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
       SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
    
    /* Analog Sine Waves
       
       This example controls an Analog Devices AD56X4 Quad Channel DAC
       (Digital to Analog Converter) by SPI and writes a 10 Hz sine
       wave to each channel that are all 90 degrees out of phase. The
       outputs are updated synchronously.
       
       Author:   Freja Nordsiek
       Notes:
       History:  * 2013-08-17 Created.
    */
    
    #include "Arduino.h"
    #include "math.h"
    #include <SPI.h>
    #include <AD56X4.h>
    
    // Output pin for the Slave Select SPI line of the AD56X4.
    
    int AD56X4_SS_pin = 10;
    
    // Define the sine wave frequencies for each channel in Hz, the
    // initial phases in degrees, the offsets, and the amplitudes.
    
    float frequencies[] = {1e1, 1e1, 1e1, 1e1};
    float phases[] = {0, 90, 180, 270};
    float offsets[] = {32768, 32768, 32768, 32768};
    float amplitudes[] = {32600, 32600, 32600, 32600};
    
    void setup()
    {
      
      // Setup SPI. This means setting pin 10 to output (arduino must
      // be the master), the AD56X4 Slave Select pin to output, the
      // SPI clock (chip's 50 MHz is way faster than our 8 MHz max),
      // and start SPI.
      
      pinMode(10,OUTPUT);
      pinMode(AD56X4_SS_pin,OUTPUT);
      SPI.setClockDivider(SPI_CLOCK_DIV2);
      SPI.begin();
      
      // Reset the AD56X4, which will power it up and set all outputs
      // to zero.
      
      AD56X4.reset(AD56X4_SS_pin,true);
      
      
    }
    
    void loop()
    {
      
      // Get the current time.
      
      float t = 1e-6 * float(micros());
      
      // Array to help in giving the library the right channel.
      
      byte channels[] = {AD56X4_CHANNEL_A, AD56X4_CHANNEL_B,
                         AD56X4_CHANNEL_C, AD56X4_CHANNEL_D};
      
      // Calculate the sine wave and put it in the input register for
      // each channel (not output by the DAC yet).
      
      for (int i = 0; i < 4; i++)
        {
          
          // Calculate the sine wave value.
          
          float y = offsets[i] + amplitudes[i]
                    * sin(2.0*M_PI*(t*frequencies[i] + phases[i]/360.0));
          //y = 0xAAAA ; //I switched to something constant just in case
          // Convert to a word (unsigned int) making sure to keep it
          // in the range [0, 0xFFFF].
          
          word output = word(y);
          
          if (y > 0xFFFF)
            output = 0xFFFF;
          else if (y < 0)
            output = 0;
            
          // Write the output to the i'th channel making sure that only
          // the input register is set (not output yet).
            
          AD56X4.setChannel(AD56X4_SS_pin, AD56X4_SETMODE_INPUT,
                            channels[i], output);
          
        }
      
      // Update all the DAC registers so that the outputs of the DAC
      // are now the new sine wave values. This is synchronous.
      
      AD56X4.updateChannel(AD56X4_SS_pin, AD56X4_CHANNEL_ALL);
      
    }
    

Children
No Data