This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

About ADS8326.

Other Parts Discussed in Thread: ADS8326

Dear All:

       I have use ADS8326 to convert a voltage:0--5V;

      My Program is:

////////////////////////////////////////

     uint AD_Convert(void)
{
   uint i;
   uint result;
   CS=1;
   delay(1,1);  
   CS=0;
   delay(1,1);

   for(i=0;i<6;i++)
   {
       DCLOCK=0;
       delay(1,1);  
       DCLOCK=1;
       delay(1,1);      
   }

   for(i=0;i<16;i++)
   {
       DCLOCK=0;
       delay(1,1);     
       DCLOCK=1;                      
       result=(result<<1)|DOUT;
       delay(1,1);     
       //delay(1,1);
   }

   CS=1;  

   return result;
}

///////////////////////////////////

by use oscilioscope to see it's signal wave,timing is right,

but Dout  isn't  right, it has some fix output value,such as:0x07c0,0x0f83,0x3e3e,and so on.

please help me this problem.

thank you.

 

  • Hi Mark,

    From a hardware standpoint - If you can share your schematic along with the scope shot of the timing, that would be helpful.  Assuming everything is wired correctly, can you tell me if what you see on SDO actually matches what is returned in your code as 'result'?  If you apply a stable DC source ot simply short the ADC inputs together, your SDO should be stable with perhaps the two LSBs toggling.  Try that and let me know what result you get from the code.

    For the code snippet above - Consider first changing your code around so that the DCLOCK is low while the /CS is high, the ADS8326 really wants to see DCLOCK low when /CS goes low.  The first while loop will give you six DCLOCK transitions, which gets you through the sample portion of the acquisition and the NULL bit, the second loop should give you the 16-bit conversion result - seems fine.  How long is the delay(1,1)?  If too much time passes between conversion clock transitions, you could be draining off the sampled voltage due to leakage currents and parasitics internal to the ADC.