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.

ADS112U04: Converting From Digital Codes to Temperature

Part Number: ADS112U04

I want to convert digital code(data coming out from ADS112) to temperature. I have gone through section 8.3.10 Temperature Sensor in datasheet, but it's little confusing.

So for example, I receive 55 AA (LSB first)data from chip then actual data would be AA55.  As only 14 MSBs are relevant, relevant data would be 2A95 (right shifted AA55 by 2 places).

2A95 = 0010 1010 1001 0101 (MSB is 0, so +ve temperature)

Converting it to temperature gives (2A95h = 10901 * 0.03125) 340.65625 °C, which looks like invalid (out of range) temperature.

So is data coming out form chip invalid or I'm doing any mistake in conversion? If so can you please explain conversion with same example?

  • Hi Heli,

    I replied to the same question in the following post:

    https://e2e.ti.com/support/data-converters/f/73/p/881515/3263233#3263233

    Your calculation is correct, but if the data you are receiving is 0xAA55, then the value being returned is incorrect.  Is this truly the value you are receiving or is this a hypothetical number?  Are you sure that the conversion result you are seeing is from the internal temperature sensor?  I suggested using the RDATA command, have you tried this?  In the end this sounds like a procedural problem with your code or configuration.

    When enabling the internal temperature sensor you must issue the START/SYNC command if you are operating in Single-Shot mode.  If operating in Continuous Conversion mode, you need to make sure that you have waited for the conversion to complete before attempting to read the result.

    Best regards,

    Bob B

  • Sorry for posting same question again. I didn't get any notification when you replied to the previous post, so I have asked it again.

    Anyways, the data I have used is what I have read from ADC and not the hypothetical number. I do have an another set of data which look correct. But I am still getting invalid data sometimes. I am reading data in manual mode (sending 0x55,0x08 to start conversion and then 0x55,0x10 to read data every time)with single shot conversion mode.  I have configured registers as below:

        ADS112_write_reg(0, 0x00);  // AINp = AIN0, AINn = AIN1, gain = 1, PGA on
        ADS112_write_reg(1, 0x01);  // DR = 20, single  mode, internal ref, temp sensor mode
        ADS112_write_reg(2, 0x00);  // data counter disabled, crc disabled, burn out disabled, idac off
        ADS112_write_reg(3, 0x00);  // idac disabled, manual mode
        ADS112_write_reg(4, 0x00);  // gpios input-not used

    where ADS112_write_reg(char reg, char data) sends  pData[] = {SYNC, CMD_WREG|(reg<<1),data} to the chip via UART.

  • Hi Heli,

    If you get the correct data sometimes and not others, you may either be having an issue with communication or you may not be waiting long enough following the START command issued to start the internal temp sensor conversion.  You need to make sure that the data has completely transmitted to the register write to enable the temp sensor before sending the START command, and then you must wait for the conversion to have fully completed before attempting to read the result.

    Best regards,

    Bob B

  • Thanks.

    It's solved. I was not waiting until DRDY transistions low and sending RDATA command to ads right after sendig START commnad.