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.

Linux/HDC2010: fail to read right value in the first reading

Part Number: HDC2010
Other Parts Discussed in Thread: HDC1010

Tool/software: Linux

Hi, I am using hdc2010 in linux, I can get the right value of temperature or humidity, but only  the first  reading about temperature or humidity is wrong, the value of MSB is always 0, and the LSB is normal. 

I don't know why, anyone can help?

  • Hi Dan,

    Please refer to the following post:

    e2e.ti.com/.../687873

    Please let me know if you have any further questions.

    Best Regards,
    Matt
  • Hi Matthew,


    I didn't find the linux driver code for HDC2010, and I just use the driver code for hdc100x which I find from my other project, and change that.


    The hdc100x chip(ex:hdc1010) use a 16-bit register, the dirver send address , write the register, first reading MSB, then LSB, I didn't change that process.


    The result is like below just like my description in the last post.


    root@root:/sys/devices/soc.3/i2c.11/i2c-0/0-0040/iio:device0# cat in_temp_raw
    [ 238.444133] The MSB value is 0**************
    [ 238.449780] The LSB value is 172**************
    172
    root@root:/sys/devices/soc.3/i2c.11/i2c-0/0-0040/iio:device0# cat in_temp_raw
    [ 240.540141] The MSB value is 121**************
    [ 240.545825] The LSB value is 175**************
    31151

    According to your link, I change the code to first reading LSB, then MSB, and I change my order to that , my code is OK.


    So the HDC2010 must first read the LSB, then MSB? I am very confused about this, because I didn't see any note in datasheet.





    Thank you!
  • Howdy Dan,

    The HDC2010 has a different register map and communication than the HDC1010 device. Please refer to the following link that may be helpful, it displays how to interface the HDC2010 device with Arduino.

    training.ti.com/how-interface-hdc2010-humidity-and-temperature-sensor-arduino-using-i2c

    The page also includes a link to the libraries. Please let me know if this helps.

    Best Regards,
    Matt