AD5621 changing voltage with step size of 64?

Hi,

           I have been working with AD5621. I wrote the code and decided to test the ADC by measuring voltage for every single digital number fed in to it via SPI.

But I am amazed to see that there is a consistent step size of 64. For example, when 3.3V is fed to the DAC and the data bit is incremented every two seconds, I get a voltage change on every 64th step. I am not sure why is that but it is very consistent. Please find below my code that I am using to construct the 2 bytes being sent to the DAC with normal mode of operation.  SPI is clocked at 62.5Khz.

void Send_Data_To_DAC(unsigned int Data)

{

    unsigned char temp1, temp2 = 0;

    temp1 = (((unsigned char) Data & 0x3F)<<2);

    temp2 = (unsigned char) ((Data>>6)& 0x3F);

    DAC_CS = 0;     // Active Low Chip Select Enabled

    SPI_Write(temp2);

    SPI_Write(temp1);

    DAC_CS = 1;          // Disable Chip Select

    return 0;

}

And the function Call is:

while (1)

{

   i++;

   Send_Data_To_DAC(i);

   Wait_2_Sec();

}

  • 0
    •  Analog Employees 
    on Oct 18, 2012 8:54 PM

    Hi,

    It looks like you might be loading the DAC with the incorrect code.
    Can you scope the digital lines and send on a scope capture please?


    Regards,

    Padraic

  • Hi,

           Thanks for the reply. I have included the code in the last post but I still did not had a chance to probe the SPI lines using scope.

    Accoring to data sheet, 2 bytes are loaded to DAC.

         My code in the above code is doing precisely that but for some reason output voltage changes after every 64th step.

  • 0
    •  Analog Employees 
    on Oct 24, 2012 1:16 PM

    Hi Just-Eng,

    I'm not disputing the code. The code looks good but unfortunatly I need to isoltae the DAC and if the code is changing every 64th step then it looks like the output is either A) getting loaded with Data every 64th step.. or B) you are trying to update the interface too quickly but..

    B) The settling time for this part is 10 micro seconds(1/4 scale to 3/4 scale step) and you clocking in at 62.5kHz so that shouldnt be an issue.

    That leaves us with A) as the most likely cause.

    If we scope the digital input lines then we can see what is happening very quickly..

    Regards,

    Padraic

  • 0
    •  Analog Employees 
    on Aug 2, 2018 4:43 PM
    This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin