I am using a LIS3DHH. It is an accelerometer but has a temperature sensor inside as well. It is read out using SPI interface. I believe that I have followed the boot sequence properly and am storing the data correctly. However, some things do not make sense. One of these is the temperature sensor reading.
The temperature sensor characteristics are contained in section 2.3. The temperature value is read out from address 25 and 26. The section 7.7 discusses these registers. It can be seen that the lowest four LSBs are all zero permanently so that the temperature reading itself comes to 12 bits rather than 16 bits.
The 16-bit reading I am getting is 0xFEC0. The table 23 says that "The value is expressed as two's complement sign. 0 LSB represents T=25degC ambient".
The 0xFEC0 I am able to read out is -320 in two's complement. If I divide this by 16 I get -20. Both of these are far from the room temperature. What is going on here?