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.

ADS131E08: false data when reading multi channel.

Part Number: ADS131E08
Other Parts Discussed in Thread: ADS131A04, ADS131E04

Hey

I am using ADS131e08 IC using arduino. ADC works fine for every individual channel, but shows garbage data when i use more than one channel. here i am enclosing read data code.

void read_data()
{
const uint8_t nof_bytes = 3*num_ch+3;
uint8_t data[nof_bytes];
long resp[nof_bytes];
memset(data, 0x00, sizeof(data));
while (digitalRead(DRDY_PIN) == HIGH);
if (digitalRead(DRDY_PIN) == LOW)
{
digitalWrite(CS_PIN, LOW);
delayMicroseconds(1);
for (int i = 0; i < nof_bytes; i++)
{
resp[i] = SPI.transfer(data[i]) ;
}
delayMicroseconds(1);
digitalWrite(CS_PIN, HIGH);
}

for (int ch = 1; ch <= num_ch; ch++)
{
long val = 0;
long value = 0;
val= (((resp[(3*(ch))+0]&0xff) << 16) | ((resp[(3*(ch))+1]&0xff) << 8) | (resp[(3*(ch))+2]&0xff));
if( ((val & 0xffffff) & (0x800000)))
{
value = val|0xff000000;
}
else
{
value = val;
}
float volt = (float(value)*2.4/8388607);
if (ch == 1)
{ Serial.print(volt); Serial.print("\t"); }
if (ch == 2)
{ Serial.print(volt); Serial.print("\t"); }
if (ch == 3)
{ Serial.print(volt); Serial.print("\t"); }
if (ch == 4)
{ Serial.print(volt); Serial.print("\t"); }
if (ch == 5)
{ Serial.print(volt); Serial.print("\t"); }
if (ch == 6)
{ Serial.print(volt); Serial.print("\t"); }
if (ch == 7)
{ Serial.print(volt); Serial.print("\t"); }
if (ch == 8)
{ Serial.println(volt); }
}
}

  • Manjeet,


    The formatting of the data for the ADS131E08 should be rather straightforward. Data for each channel comes out sequentially after the status register. However there may be a couple of things to check.

    Are any of the data correct? Do you get completely random values for all channels?

    Another important question is how do you read the data. Are you in read data continuous mode and only sending SCLKs after the /DRDY goes low? If you are using this mode, do you clock out the data from all of the channels before the next /DRDY? Or have you send the SDATAC command which stops the read data continuous mode and are using RDATA to read the data.

    One thing you can do is get a logic analyzer or oscilloscope to read the output data directly from the screen. This way you can see that the data comes out correctly and isn't misinterpreted from your code. I don't see anything wrong with your code, but I'm generally not a programmer, so I'm not an expert in that. However, I would print the output code from the ADC, and not the converted values. This eliminates one other potential problem from the code. When you do this, post back with the output results, and what your inputs are. We can compare the input voltages and output codes directly.

    Regardless, look through my post, answers my questions, and check the logic analyzer or scope and post the results back.


    Joseph Wu

  • Manjeet,

    I haven't heard from you for a while, so I thought I'd check in to see if you've solved your data readout problem. I did suggest some methods to debug your communication.

    I'll close this post for now, but if you still haven't solved your problems, post back and we can continue working on this.

    Joseph Wu

  • Joseph Wu

    sorry for late reply. I have already wasted lot of time on ADS131e04 so i decided to shift to ADS131a04 and it works fine for me. i get all 4 channel data simultaneously. 

    Thanks Joseph Wu.