AnsweredAssumed Answered

AD5420 No Output.

Question asked by ad.5420 on Nov 20, 2014
Latest reply on Dec 1, 2014 by ad.5420

Hi,

 

I'm using AD5420, and configured it for 4 - 20mA. I've monitored SDI, SCK and LATCH signals on DSO and seems to be OK.

below is the schematic and code, Please guide me, where I'm doing wrong,

 

#define AD54XX_CONTROLBITS 0x00553005

#define AD54XX_ADDRESSBITS 0x00010000

#define AD54XX_RESETBITS 0x00560001

 

void Write_Analog_Output( unsigned long int data)

{

  

    LONG utemp;

    unsigned int temp, t1;  

    INT8 j, k, temp1, l;

 

           utemp = data;

          temp = (unsigned int) utemp;

          temp1 = (utemp >> 16);

    SD_SDI = 0;

    SD_SCK = 0;

     

          for(j = 0; j < 24; j++)

           {            

            SD_SCK = 1;    

             

              if(j < 8)

              {

                  t1 = temp1;

                  t1 = (t1 >> (7 - j));

              }

              else

              {

                 t1 = temp;

                  t1 = (t1 >> (15 - l));

                   l++;

              }               

          

             if(t1 & 0x0001)

                SD_SDI = 1;

             else

                SD_SDI = 0; 

         

            for(k = 0; k < 20; k++);

       

                 SD_SCK = 0;

              

             for(k = 0; k < 20; k++);

       }

        LATCH = 0;

       

         for(k = 0; k < 30; k++);

            LATCH = 1;

          for(k = 0; k < 30; k++);

             LATCH = 0;

    SD_SCK = 0;

    SD_SDI = 0;

}

 

int main()

{

     delay();delay();delay();

      uc_init();

      Write_Analog_Output( AD54XX_RESETBITS);

      delay();delay();delay();

      delay();delay();delay();

 

      Init_AD54xx();

 

while(1)

{

    Write_AD54XX(data_ad);

    delay();delay();delay();

     delay();delay();delay();

}

 

Message was edited by: anjali shelke

Attachments

Outcomes