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.

TMP102: temperature register transfer back temp degree

Part Number: TMP102

Hi Sirs,

We have use TMP102, we to read temperature register the value is 40250(digital) = 0x9D3A

How to  transfer back temp degree?

Seems driver return value unit is milliCelsius, is that correct?

Like
40250 mC = 40.25 degree?

  • Hi Shu-Cheng,

    Can you share the driver that you are using? Your software should look similar to the following, where HiByte is the first 8 bits received via I2C, and LoByte is the second 8 bits received.
    float convertTemp(char HiByte, char LoByte) {
    float temp;
    temp = (float) (HiByte << 8 | LoByte);
    temp *= 0.00390625; // equal to *2^-8 or /2^8 or >> 8
    return temp;
    }

    Could you share an oscilloscope shot of your communication? The result of 0x9D3A doesn't make sense for TMP102's 12 bit or 13 bit modes. In both cases, it would indicate an erroneous negative temperature.

    Thanks,
    Ren
  • Hi Sirs,

    Please refer our reply as bellow

    We use SoC vendor’s native SDK with existing TMP102 driver which you can find in the below URL:

            https://elixir.free-electrons.com/linux/v3.9.11/source/drivers/hwmon/tmp102.c

    I just read device attribute temp1_input from the sysfs after driver installed.

    By the way, could you provide TI official TMP102 driver example for our reference?

    Thanks!!

  • Hi Shu-Cheng,

    This driver is provided with the Linux Kernel, and was created by the Open Source Community. TI does not support this driver. TI does not offer a TI-official Linux Kernel driver for TMP102.

    That said, if you look at the source code that you linked, there are comments which note that the temperature result is converted to milicelsius.

    For anyone else looking for a TMP102 driver, please see the Arduino example on the TMP102 product landing page. http://www.ti.com/product/TMP102/toolssoftware


    Thanks,
    Ren