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.

ADS 1256 Status Register reading Problem

HI

I am working on ADS 1256 TI 24 bit ADC. I have made the hardware connections as per the data sheet.

Specification of different pins is as follows

AVDD=5V , DVDD= 3.3V, VREFP=2.5V VREFN=GND, PDWN and RESET=3.3V and AGND, DGND and  AINCOM are connected to ground and Crystal i have used is of 8MHZ for ADC.

Clock Frequency used for SPI is 2MHZ which is 1/4 of fCLKIN as per the data sheet.

I am successful to get pulses on DRDY pin hence i am assuming that my adc ic is in working condition.

But when i am trying to read anything from status register for manufacturer id  but i am getting only 0xff value from the adc.

I have also tried to read the voltage through the analog channel 1 with default setting of adc but no success.

My code for reading Status register is as follows.


CE_Low();

while(DRDY);

WriteSpi(0x0F);

ADC_delay(500);
WriteSpi(0x10);
WriteSpi(0x01);

ADC_delay(130);

ch1=WriteSpi(0x00);

ch2=WriteSpi(0x00);

ch3=WriteSpi(0x00);

CE_High();

My questions are as follows

1. What is the expected id should it return when i read the status register.

2. If i execute this part of code directly without any other command of ADC will it works.

3. Which modes of SPI this ADC supports?

4. If i give the more delay than specified by data sheet will it affect the functionality of ADC?

Am I missing something?

 Please Suggest some suitable help regarding the above issues.

Thank you in advance.

 

  • Hi

    Finally i am getting the response from the ADC.

    Now i can read the status registers and write the different ADC register.

    If i read the ADC register after writing into it i am getting the same data which i have written.

    But no luck yet in reading the analog channels.

    I am trying to read in differential mode and battery positive is connected to AN0 channels thought combinations of registers and capacitors as mentioned by the data sheet.

    and negative terminal to AN1 channel as these are channels when adc power up and i am trying to read with the reference of DRDY line but ADC is giving me random values .

    AINCOM is connected to ground.

    I have issued the SDATAC command in the beginning. Please suggest what could be missing thing.

    Thank you.

  • Hi Rohit,

    Welcome to the TI E2E Forums!

    What changes (if any) did you make to get the ADC to respond, if I may ask?

    I have some example code that shows how to multiplex and read data for two different input channels. I'm attaching it here: 6327.ADS1256 Example - Multiplexing Channels.zip

    Let me know if this helps!

    Also, if you could share a schematic of your input circuitry - it would help me understand your measurement setup.


    Thanks and Best Regards,
    Chris

  • Hi

    Chris, Thank you for your response.

    Actually the bug was in the hardware side the SDI and SDO line was not swapped at ADC side.

    So when  I fixed this bug ADC started working and thank you for the code example it was really helpful.

    Now I can read in single shot mode and also by changing the channels. Results are satisfactory.

    But the continuous read is still not working after issuing the read continuous command i am getting the random data .

    same code with 0x01 is working fine.

    Please Suggest what could be the possible reasons that it is not working.

    Thank you in anticipation.

  • Hi Rohit,

    Glad to hear you're making progress! What is your new SPI command sequence?

    Some possible reasons could be the following:

    • In "read data continuous" mode you should only need to clock out the data - no need to send the RDATA command (0x01) anymore.

    Perhaps you're not aligning with the data when you read from the SPI.

    • Also if you have a step change on your input signal, (at the default data rate of 30,000 SPS) it takes 5-6 conversion cycles for the data to settle. At the slower data rates you'll get single-cycle settling. Refer to table 15 in the data sheet.

    Best Regards,
    Chris

  • Hi

    Chris,

    Thank you for your help. I am using the adc with 30k sampling rate and now getting the correct reading for continuous mode .

    But the reading are coming after some garbage readings now the questions is how to sort the correct readings out of the combination of garbage and  correct readings.

    As the frequency of the correct reading is not fix and trying with different delays so that I can get correct readings with fix garbage readings . Also I tried to change the data rate and tried lower data rate but no success.

    I think my delay are not proper. I have created one delay function with the help of timer and it generates 1 micro-sec delay. τ CLKIN =1/(8MHZ)

    The sequence for continuous reading is as follows.

    while(DRDY);       // Wait for DRDY to be low
    WriteSpi(0x03);    // ADC Continuous read command
    Timer_Delay(300); // t6 delay from the data sheet (50 x 6 usec = 300 usec)

    while(DRDY);          
    ch1=WriteSpi(0x00); // ADC Output MSB
    Timer_Delay(24);

    while(DRDY);
    ch2=WriteSpi(0x00); // ADC Output MID
    Timer_Delay(24);


    while(DRDY);
    ch3=WriteSpi(0x00); // ADC Output LSB
    Timer_Delay(24);

    Please help regarding the delay.

    Thank you in advance.

  • Hi Rohit,

    You shouldn't need the additional delay time between commands. I've commented them out below:

    while(DRDY);          
    ch1=WriteSpi(0x00); // ADC Output MSB
    //Timer_Delay(24); 
    
    while(DRDY);
    ch2=WriteSpi(0x00); // ADC Output MID
    //Timer_Delay(24);
    
    while(DRDY);
    ch3=WriteSpi(0x00); // ADC Output LSB
    //Timer_Delay(24);

    Are you able to capture an oscilloscope or logic analyzer screenshot of the SPI communication?

    Best Regards,
    Chris