AnsweredAssumed Answered

AD5621 changing voltage with step size of 64?

Question asked by Just-Eng on Oct 18, 2012
Latest reply on Oct 24, 2012 by Padraic

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();

}

Outcomes