AD5754R applicition question.

Hi, 

I am now using AD5754R, but the VDAC output is always low voltage level.

I have refer to the Demo software, and do just a little modify for the Vout level as below:

//控制寄存器
WriteData1 = 0x1C; //BIT23~BIT16
WriteData2 = 0x00; //BIT15~BIT8
WriteData3 = 0x00; //BIT7 ~ BIT0
WriteToAD5754(); 

//电源寄存器
WriteData1 = 0x10; //BIT23~BIT16
WriteData2 = 0x00; //BIT15~BIT8
WriteData3 = 0x1F; //BIT7 ~ BIT0  
WriteToAD5754();   
       
//控制电压输出范围
WriteData1 = 0x0C;
WriteData2 = 0x00;
WriteData3 = 0x00;
WriteToAD5754();
 
 //DAC输出寄存器
 WriteData1 = 0x04;
 WriteData2 = 0x7F;
 WriteData3 = 0x8F;            
 WriteToAD5754();

//SPI function
void WriteToAD5754()//(long int WrData) 
{
     unsigned char  i;

     DAC_SPI_SYNC_ON;
   Delay_Us(10);
   DAC_SPI_SYNC_OFF;    //ÖõÍÓÐЧ
   Delay_Us(10);

 //Write out the ControlWord
   for(i=0; i<8; i++)
  {
     DAC_SPI_SCLK_ON;
       Delay_Us(10);
     if(WriteData1&0x80) 
    {
      DAC_SPI_SDI_ON;   //Send one to SDI pin
    }
     else
    {
      DAC_SPI_SDI_OFF;   //Send zero to SDI pin
    }

     Delay_Us(10);
     DAC_SPI_SCLK_OFF;
     Delay_Us(10);

     WriteData1 <<= 1;     //Rotate data
     Delay_Us(10);
    } 
   for(i=0; i<8; i++)
  {
     DAC_SPI_SCLK_ON;
       Delay_Us(10);
     if(WriteData2&0x80)
    {
      DAC_SPI_SDI_ON;   //Send one to SDI pin
    }
     else
    {
      DAC_SPI_SDI_OFF;   //Send zero to SDI pin
    }

     Delay_Us(10);
     DAC_SPI_SCLK_OFF;
     Delay_Us(10);

     WriteData2 <<= 1;     //Rotate data
     Delay_Us(10);
    } 
   for(i=0; i<8; i++)
  {
     DAC_SPI_SCLK_ON;
       Delay_Us(10);
     if(WriteData3&0x80)
    {
      DAC_SPI_SDI_ON;   //Send one to SDI pin
    }
     else
    {
      DAC_SPI_SDI_OFF;   //Send zero to SDI pin
    }

     Delay_Us(10);
     DAC_SPI_SCLK_OFF;
     Delay_Us(1);

     WriteData3 <<= 1;     //Rotate data
     Delay_Us(10);
    } 
   DAC_SPI_SCLK_ON;
 Delay_Us(10);
   //SPI ends
   DAC_SPI_SYNC_ON;
     Delay_Us(10);
}
void Delay_Us(unsigned int us)
{
   unsigned int i=0;
   for(i=0;i<us;i++)
  {
    __NOP();   
  __NOP();
  __NOP();
  __NOP();
    }
}

Is there anyone can help me check it, Thanks very much.

Parents Reply Children