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.

ADS1262: Temperature sensor acquisition

Part Number: ADS1262

Hi,

I'm using the external ADC the ADS1262.

I would like having the internal temperature. But I have some trouble.

As it is said on the datasheet p35/133 the PGA gain = 1 and the internal voltage is set.

The INPMUX for the ADC 1 is set to 0xbb.

I can receive some data from the ADS but I'm not able to translate it in a correct format.

I use the following equation :

Temperature (°C) = [(Temperature Reading (µV) – 122,400) / 420 µV/°C] + 25°C

Is this one correct because I don't know the unit of the 122.4 value and it is written in the page 8/133 this is in mV?

Thank you

  • Hi Lemoine,

    You are correct about the ADS1262 configurations required to use the internal temperature sensor (PGA = 1 V/V, and INPMUX = 0xBB).

    Also, equation 9, "Temperature (°C) = [(Temperature Reading (µV) – 122,400) / 420 µV/°C] + 25°C", is correct...

    In order to use this equation; however, you will need to convert the ADC's reading into µV's first. Assuming Vref = 2.5V and PGA = 1 V/V, results in 1 LSB = 0.001164153 µV/code.

    Therefore, if the ADC reading is 0x0644523F (or 105140799 in decimal), you would multiply 105140799 codes x 0.001164153 µV/code = 122,399.9 µV. Plugging this value into equation 9 results in ~25°C. So as you can see, the temperature sensor reading is about 122.4 mV at room temperature (25°C).

     

    There is also an Excel calculator that can help with this calculation, found here:
    www.ti.com/.../ads126x-calc-tool


    Does that answer your question?

    Best regards,
    Chris

  • Hi,

    my first problem was : I was using only 24bits. That's why I wondered if the equation was correct.

    To follow your example I use all the 32 bits. I created the word like this :

    (((long)DATA_DATA1<<24) | ((long) DATA_DATA2<<16) | ((long)DATA_DATA3<<8) | DATA_DATA4)

    In my example I have this : 52538719

    In yours you said if we do 105140799 x 0.001164153 µV/code = 122,399.9 µV. But in fact this is equal to 122399.9766. So did you divide by 1000?

    If so, I did the same and I obtained 52538719 x 0.001164153 µV/code / 1000 = 61.16310....

    My value seems to be divide by two. May I doing something wrong?

    Thank you

     

  • Hi Alexandre,

    That's okay... If you do decide only to use 24-bits, then you'll just need to adjust the LSB size for 24-bits (it will be 256 times larger than the 32-bit LSB size). Either way, you'll just need to convert the data into µVs first.

    Using "52538719", you would get:

    52538719 codes  x 0.001164153 µV/code = 61,163.1 µV
    Temperature (°C) = 25°C + [ (61,163.1µV -122,400µV) /  420 (µV/°C) ] = -120 °C

    ... Note the 420 µV/°C divisor, which is the slope/sensitivity of the temperature sensor.
    ...Going by this value, I would question the validity of your measurement result.
     

    Did you by chance disable the internal reference?
    It should be enabled when measuring the internal temperature sensor.

    Best regards,
    Chris

  • Hi,

    Thank you for all our answer.

    Now it's work.

    I think I had two errors. First one was I'm not sure I was using the internal reference. And the second one was I didn't convert the result correctly.

    So, here is my configuration:

    Ads1263Regs.Id.all = 0x00;
    Ads1263Regs.Id.Id_bit.REV_ID_2_0 = ADS1262;

    Ads1263Regs.Power.all = 0x00;
    //Ads1263Regs.Power.Power_bit.RESET = 1;
    Ads1263Regs.Power.Power_bit.VBIAS = VBIAS_DISABLED; // 0: Disabled; 1: VBIAS enabled; Level Shift Voltage P44/133
    Ads1263Regs.Power.Power_bit.INTREF = INT_REF_ENABLED; // 0: Disabled; 1: Internal reference enabled

    Ads1263Regs.Interface.all = 0x00;
    Ads1263Regs.Interface.Interface_bit.TIMEOUT = 0; // 0: Disabled; 1: Enable the interface automatic time-out
    Ads1263Regs.Interface.Interface_bit.STATUS = 1; // 0: Disabled; 1: Status byte included during conversion data read-back P70/133
    Ads1263Regs.Interface.Interface_bit.CRC = CHECKSUM_IN_CHECKSUM_MODE; // P72/133

    Ads1263Regs.Mode0.all = 0x00;
    Ads1263Regs.Mode0.Mode0_bit.REFREV = NORMAL_POLARITY;
    Ads1263Regs.Mode0.Mode0_bit.RUNMODE = CONTINUOUS_CONVERSION;
    Ads1263Regs.Mode0.Mode0_bit.CHOP = INPUT_CHOP_AND_IDAC_ROTATION_DISABLED; // P84/133
    Ads1263Regs.Mode0.Mode0_bit.DELAY = NO_DELAY;

    Ads1263Regs.Mode1.all = 0x00;
    Ads1263Regs.Mode1.Mode1_bit.FILTER = SINC4_MODE;
    Ads1263Regs.Mode1.Mode1_bit.SBADC = 0; // 0: Sensor bias connected to ADC1 mux out; 1: Sensor bias connected to ADC2 mux out;
    Ads1263Regs.Mode1.Mode1_bit.SBPOL = 0; // 0: Sensor bias pull-up mode (AINp pulled high, AINn pulled low); 1: Sensor bias pull-down mode (AINp pulled low, AINn pulled high);
    Ads1263Regs.Mode1.Mode1_bit.SBMAG = NO_SENSOR_BIAS_CURRENT; // P34/133

    Ads1263Regs.Mode2.all = 0x00;
    Ads1263Regs.Mode2.Mode2_bit.BYPASS = PGA_ENABLED; //P37/133
    Ads1263Regs.Mode2.Mode2_bit.GAIN = PGA_GAIN_2;
    Ads1263Regs.Mode2.Mode2_bit.DR = DATA_RATE_19200_SPS;

    Ads1263Regs.Inpmux.all = 0x00;
    Ads1263Regs.Inpmux.Inpmux_bit.MUXP = AIN6;
    Ads1263Regs.Inpmux.Inpmux_bit.MUXN = AIN7; // P33/133

    Ads1263Regs.Ofcal0.all = 0x00;
    Ads1263Regs.Ofcal1.all = 0x00;
    Ads1263Regs.Ofcal2.all = 0x00;

    Ads1263Regs.Fscal0.all = 0x00;
    Ads1263Regs.Fscal1.all = 0x00;
    Ads1263Regs.Fscal2.all = 0x40; // gain = 1.0

    Ads1263Regs.Idacmux.all = 0x00;
    Ads1263Regs.Idacmux.Idacmux_bit.MUX2 = NO_CONNECTION;
    Ads1263Regs.Idacmux.Idacmux_bit.MUX1 = NO_CONNECTION; // P43/133

    Ads1263Regs.Idacmag.all = 0x00;
    Ads1263Regs.Idacmag.Idacmag_bit.MAG2 = IDAC_OFF;
    Ads1263Regs.Idacmag.Idacmag_bit.MAG1 = IDAC_OFF; // P43/133

    Ads1263Regs.Refmux.all = 0x00;
    Ads1263Regs.Refmux.Refmux_bit.RMUXP = REFERENCE_INTERNAL_ANALOG_SUPPLY; // P41/143
    Ads1263Regs.Refmux.Refmux_bit.RMUXN = REFERENCE_INTERNAL_ANALOG_SUPPLY; // P41/143

    Ads1263Regs.Tdacp.all = 0x00;
    Ads1263Regs.Tdacp.Tdacp_bit.OUTP = 0; // 0: No connection; 1: TDACP output connected to pin AIN6
    Ads1263Regs.Tdacp.Tdacp_bit.MAGP = OUTPUT_MAGNITUDE_2_5V; // P53/133

    Ads1263Regs.Tdacn.all = 0x00;
    Ads1263Regs.Tdacn.Tdacn_bit.OUTN = 0; // 0: No connection; 1: TDACP output connected to pin AIN7
    Ads1263Regs.Tdacn.Tdacn_bit.MAGN = OUTPUT_MAGNITUDE_2_5V; // P53/133

    Ads1263Regs.Gpiocon.all = 0x00;
    Ads1263Regs.Gpiocon.Gpiocon_bit.CON0 = GPIO_NOT_CONNECTED;
    Ads1263Regs.Gpiocon.Gpiocon_bit.CON1 = GPIO_NOT_CONNECTED;
    Ads1263Regs.Gpiocon.Gpiocon_bit.CON2 = GPIO_NOT_CONNECTED;
    Ads1263Regs.Gpiocon.Gpiocon_bit.CON3 = GPIO_NOT_CONNECTED;
    Ads1263Regs.Gpiocon.Gpiocon_bit.CON4 = GPIO_NOT_CONNECTED;
    Ads1263Regs.Gpiocon.Gpiocon_bit.CON5 = GPIO_NOT_CONNECTED;
    Ads1263Regs.Gpiocon.Gpiocon_bit.CON6 = GPIO_NOT_CONNECTED;
    Ads1263Regs.Gpiocon.Gpiocon_bit.CON7 = GPIO_NOT_CONNECTED;

    Ads1263Regs.Gpiodir.all = 0x00;
    Ads1263Regs.Gpiodir.Gpiodir_bit.DIR0 = GPIO_IS_AN_INPUT;
    Ads1263Regs.Gpiodir.Gpiodir_bit.DIR1 = GPIO_IS_AN_INPUT;
    Ads1263Regs.Gpiodir.Gpiodir_bit.DIR2 = GPIO_IS_AN_INPUT;
    Ads1263Regs.Gpiodir.Gpiodir_bit.DIR3 = GPIO_IS_AN_INPUT;
    Ads1263Regs.Gpiodir.Gpiodir_bit.DIR4 = GPIO_IS_AN_INPUT;
    Ads1263Regs.Gpiodir.Gpiodir_bit.DIR5 = GPIO_IS_AN_INPUT;
    Ads1263Regs.Gpiodir.Gpiodir_bit.DIR6 = GPIO_IS_AN_INPUT;
    Ads1263Regs.Gpiodir.Gpiodir_bit.DIR7 = GPIO_IS_AN_INPUT;

    Ads1263Regs.Gpiodat.all = 0x00;

    And here how I can convert it.

    AQ_Mesures.AQ_TADS.iq_Mesure_Instantanee = _IQmpy((((long)DATA_DATA1<<24) | ((long) DATA_DATA2<<16) | ((long) DATA_DATA3<<8) | DATA_DATA4), _IQ(0.0011641532*100.0)); // ref/2^31 = 2500000µV/2^31 le x100 permet une meilleure précision
    AQ_Mesures.AQ_TADS.iq_Mesure_Instantanee = _IQdiv(AQ_Mesures.AQ_TADS.iq_Mesure_Instantanee, _IQ(100.0)); // permet de supprimé le x100 précédent.
    AQ_Mesures.AQ_TADS.iq_Mesure_Instantanee = AQ_Mesures.AQ_TADS.iq_Mesure_Instantanee - 122400;
    AQ_Mesures.AQ_TADS.iq_Mesure_Instantanee = _IQdiv(AQ_Mesures.AQ_TADS.iq_Mesure_Instantanee, 420.0);
    AQ_Mesures.AQ_TADS.iq_Mesure_Instantanee = AQ_Mesures.AQ_TADS.iq_Mesure_Instantanee + _IQ(25.0);

    AQ_Mesures.AQ_TADS.s32_Mesure_Instantanee = (Sint32)((Uint32)(AQ_Mesures.AQ_TADS.iq_Mesure_Instantanee*10)>>GLOBAL_Q); // Résultat au 10e de degré

    If more explaination is needed I can explain.

    Best regards

  • I did a mistake :
    Ads1263Regs.Inpmux.all = 0x00;
    Ads1263Regs.Inpmux.Inpmux_bit.MUXP = TEMPERATURE_SENSOR_MONITOR_POSITIVE;
    Ads1263Regs.Inpmux.Inpmux_bit.MUXN = TEMPERATURE_SENSOR_MONITOR_NEGATIVE; // P33/133
  • Hi Alexandre,

    Alexandre LEMOINE said:
    Ads1263Regs.Refmux.Refmux_bit.RMUXP = REFERENCE_INTERNAL_ANALOG_SUPPLY; // P41/143
    Ads1263Regs.Refmux.Refmux_bit.RMUXN = REFERENCE_INTERNAL_ANALOG_SUPPLY; // P41/143

    This part of your device configuration will have an effect on the result...I had calculated the LSB size for a 2.5V reference. For a 5V reference, you'll need to double the LSB size mentioned above.

    Alexandre LEMOINE said:
    AQ_Mesures.AQ_TADS.s32_Mesure_Instantanee = (Sint32)((Uint32)(AQ_Mesures.AQ_TADS.iq_Mesure_Instantanee*10)>>GLOBAL_Q); // Résultat au 10e de degré

    I don't fully understand this particular line of code. I believe you have the correct temperature measurement result in the line of code just above this.

     

    I hope that helps!

    Best regards,
    Chris

  • Hi Christopher,

    I'm not sure I understand your question.

    "This part of your device configuration will have an effect on the result...I had calculated the LSB size for a 2.5V reference. For a 5V reference, you'll need to double the LSB size mentioned above."

    But in my case, AVDD = +2.5V and AVSS = -2.5V. So, this is maybe it's work.

    AQ_Mesures.AQ_TADS.iq_Mesure_Instantanee is in IQ format. So the result is a multiple of IQ format.

    AQ_Mesures.AQ_TADS.s32_Mesure_Instantanee is SInt32. So I want convert iq_Mesure_Instantanee to s32_Mesure_Instantanee. To do this, I divide iq_Mesure_Instantanee by IQ format. In that case this is a shift register.

    I want one decimal so before shifting I multiplied by 10.

    To be clear the real result should be like this :

    T°C = [(data(32bits)*0.0011641532 - 122400) / 420] + 25°C

  • Hi Alexandre,

    I had assumed in my LSB size calculation that you would be using the internal 2.5-V reference. This resulted in the LSB size of 0.0011641532 uV/code.

    If you instead select the 5-V analog supply as the ADC's reference source, then the LSB size becomes 5V / 2^(32-1) = 0.0023830644 uV/code.

    Alexandre LEMOINE said:

    To be clear the real result should be like this :

    T°C = [(data(32bits)*0.0011641532 - 122400) / 420] + 25°C

    This equation is correct, assuming a 2.5-V reference. However, you can modify the LSB size as needed for any reference voltage.

    As long as your IQmath functions are correctly implementing this calculation you should be fine. It makes a lot of sense to me to that you would multiply the LSB size by 10 to improve the integer math accuracy, and then later divide by the same factor to properly scale the result.

    Best regards,
    Chris