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.

UCD90320: READ_TEMPERATURE_1

Part Number: UCD90320

Hi,

Good Day. I have a customer who is working with UCD90320. Please see below his query for your reference. Thank you very much.

READ_TEMPERATURE_1 register is a 16-bit register, what do I do with the value of the computer temperature of the device?

The device documentation describes how to use READ_TEMPERATURE_2 but not READ_TEMPERATURE_1.

Note that my major problem is that someone wrote code to display the temperature but the temperature displayed is colder than ambient. So this should not be possible and I need to manually check the code that is reading this register.

Best Regards,

Ray Vincent

  • Hi

    The interpretation is the same for READ_1 and READ_2.

    Please be noted that READ_1 returns internal temp which has some variations defined in the data sheet.

    Regards

    Yihe 

  • Hi Yihe,

    Good Day. Please see below the response of our customer to your reply. Thank you very much.

    Please provide a working example of this method because when I use it the temperature is 5 degC when I think it should be near 50C (the current SW code that displays this temperature says the temp is 30C).

    Both values are wrong, and I am trying to understand where the error is.

    Best Regards,

    Ray Vincent

  • Hi

    Please refer the temperature reading section.https://www.ti.com/lit/pdf/slva385 

    Regards

    Yihe

  • Hi Yihe,

    Good Day. Please see the latest response from our customer. Thank you very much.

    Please provide a working example of this method because when I use it the temperature is 5 degC when I think it should be near 50C (the current SW code that displays this temperature says the temp is 30C).

    Both values are wrong, and I am trying to understand where the error is.”

     

    The document:

    Reading Temperature

    If the user understands how to make a current reading, then the user should have no problem learning how

    to make a temperature measurement reading. The command used for reading a temperature associated

    with a given rail is READ_TEMPERATURE_2 (0x8E). The calculated temperature measurement is in units

    of °C. The temperature is calculated as Temperature = T × 2X; in which T is the 11-bit signed two's

    complement integer obtained from the 11 least significant bits of READ_TEMPERATURE_2 and X is the

    5-bit signed two's complement integer obtained from the 5 most significant bits of

    READ_TEMPERATURE_2.

    • Select the Rail: The PAGE command is set just as it was done with voltage and current measurement

    readings.

    Read the T value and the exponent: The READ_TEMPERATURE_2 (0x8E) is a two-byte command

    that contains the exponent (X) and the T value for the equation Temperature = T × 2X.

    Read READ_TEMPERATURE_2 command (0x8E)

    [St] [AddrW] [A] [W:x8E] [A] [Sr] [AddrR] [A] [R:Data_1] [A] [R:Data_2] [N] [Sp]

    Let's assume that the data read back was Data_1 = 0xDB and Data_2 = 0x21. Breaking down to the

    11 least significant bits you get that T = 801 decimal. The 5 most significant bits give you 27 decimals

    and its two's complement leads to an exponent of -5.

    • Calculate the Temperature Measurement: Now we have all the data necessary to calculate the

    measured temperature.

    Solving the equation Temperature = T × 2X

    Temperature = 801 × 2-5 = 25.03°C”

     

    Show the binary value read from the register.

    0xdb21

    b1101 1011 0010 0001

    Show the 11-bit value and the converted “801” two complement values.

    B01100100001

    Two’s complement: ??

    Show the 5-bit value and the converted “-5” two complement values.

    B11011

    Two’s complement: ??

    Using the converted values, show all the math.

    Indicate which register values get converted, and which values do not.

     

    I have coded something that appears to work but the method does not align with the TI documentation.

    Best Regards,

    Ray Vincent

  • Hi

    The example listed in the document

    0xdb21 -> 1101 1011 0010 0001b

    The MSB 5 bits is signed exponent 11011b. the MSB 1, so it is a negative number, its twos-complement is 00101 = -5

    The LSB 11 bits is 011 0010 0001b so it is positive number = 0x321=801.

    The final value is 801*2^-5 = 25C.

    Hope he can understand all these. 

    Regards

    Yihe

    .