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.

ADS1258 unipolar operation with negative value ?

I have searched the similar issue reported in the forum. 

But I dont use differential operation (single end,)  and measured signal source is 3V~4V, not near zero.

AINCOM is grounded

use REF5040 (4.096V) as ref voltage.

schematics

the result shows the negative value is abnormally got in 200 samples. (channel AIN7)

all channel possible see the same scenario. I just take AIN7 for example.

this is my signed data operation

b2b3 = data & 0xffffff;
if (b2b3 & 0x800000) {
signed_b2b3 = 0xff000000 | b2b3;
}

please help.

thanks

  • Hi Ivan,

    I assume that "data" is a 32-bit signed integer...therefore, how are you constructing "data" from the 8-bit data bytes?

    Perhaps you're missing a cast when performing the bit-shift operation, in which case your code might be performing the bit-shift operation on the "char" (8-bit) datatype.

    Another possibility is that the data is somehow out of alignment. The "-7376278" negative result and value immediately after it "7498475" both have similar hex values ("FF8F726A" and "00726AEB", respectively).

    ...These types of issue are difficult to diagnose without also seeing the raw data. By only looking at the code results, you cannot tell if the error is in the code or if it is an SPI communication error.

    Try to probe other variables in you code (before combining the data bytes) to make sure your code is operating on the data correctly.

    Best Regards,
    Chris