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.

ADS1298 Convert output code to volts

Other Parts Discussed in Thread: ADS1298

Hello guys
Tell me how to convert output codes od ADS1298 to volts.

I watched articles from the forum: https://e2e.ti.com/support/data-converters/f/73/t/772488 - I think there is an error in coverts data
I calculate the weight of one code using the formula: LSB = (2 * Vref_voltage) / Gain / (2^23)-1;

Then I check what is MSB: 

Output_code_ADS1298  - Conversion result of ADS1298

Output_code_ADS1298  AND with mask 0x800000, if MSB=0, then Voltage = Output_code_ADS1298 * LSB

if MSB=1, then Voltage = (Output_code_ADS1298  - 2^23) * LSB;

When converting output codes to voltage, I get an incorrect voltage value.

  • Hi Red, 

    Please read through the article you linked again. You calculated the LSB size incorrectly. 

    LSB = (2 x VREF)/ Gain / (2^24 - 1)

  • Alexander, thanks for the quick responce
    if MSB=1, then Voltage = (Output_code_ADS1298  - 2^23) * LSB; - this is formula also incorrect?
    In this formula I have to substract 2^24 ? but not 2^23 like now ?

  • Hi Red,

    As it says later in the post:

    "The most straightforward way to convert your output codes back into input voltage is to AND the data with 0x800000 and test the MSB (most-significant bit). If the MSB equals 0, simply multiply the decimal equivalent by the LSB size. If the MSB = 1, you must first subtract 2^n from the decimal equivalent, then multiply by the LSB size. "

    Your second equation is correct. It was the first equation where you calculated MSB size that was incorrect. The order of operations, PEMDAS, sometimes confuses people.