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.

how to read the temperature form TMP75

Other Parts Discussed in Thread: TMP75

HI:

   how to read the temperature  form the TMP75?  now I can read the value of  reg 00 ,reg 01,reg 02,reg 03 。but i dot  know how to convert  to temperature  according to these registers!

  • Hi,

    The TMP75 outputs temperature data in a Q4 Format (2's complement with 4 Fractional bits), as shown in Table 7-1.

    For reference, here is some example C-code for performing this conversion. This code was auto-generated by our ASC Code Studio Tool for TMP1075.

    /*
     *  ======== TMP1075_toFloatCelsius ========
     *  Convert raw temperature register value to degrees Celsius
     */
    float TMP1075_toFloatCelsius(int32_t x)
    {
        /* Shift raw register value to form a proper Q4 value */
        x >>= 4;
    
        /* Convert Q4 value to a float */
        return ((float)x * 0.0625f);
    }

    Best Regards,
    Brandon Fisher