Ive been reading up on readtemp12 and the threads associated with it.
http://www.picaxeforum.co.uk/showthread.php?t=8329
is the main one I found
The LM75a uses i2c and has the following
Datasheet
http://www.nxp.com/acrobat_download/datasheets/LM75A_4.pdf
Excerpt
Can anyone point, shout, kick me in the right direction.
My check to see if its negative is
If w0 >= $7FF then negative
I am unsure of where to go from there.
Thanks,
Derek L
http://www.picaxeforum.co.uk/showthread.php?t=8329
is the main one I found
The LM75a uses i2c and has the following
Datasheet
http://www.nxp.com/acrobat_download/datasheets/LM75A_4.pdf
Excerpt
Code:
The Temperature register (Temp) holds the digital result of temperature measurement
or monitor at the end of each analog-to-digital conversion. This register is read-only and
contains two 8-bit data bytes consisting of one Most Significant Byte (MSByte) and
one Least Significant Byte (LSByte). However, only 11 bits of those two bytes are used to
store the Temp data in 2’s complement format with the resolution of 0.125 °C. Table 9 shows the
bit arrangement of the Temp data in the data bytes. When reading register Temp, all 16 bits of
the two data bytes (MSByte and LSByte) are provided to the bus and must be all collected by
the controller to complete the bus operation. However, only the 11 most significant bits should
be used, and the 5 least significant bits of the LSByte are zero and should be ignored.
One of the ways to calculate the Temp value in °C from the 11-bit Temp data is:
1. If the Temp data MSByte bit D10 = 0, then the temperature is positive and Temp value (°C) = +(Temp data) ´ 0.125 °C.
2. If the Temp data MSByte bit D10 = 1, then the temperature is negative and Temp value (°C) = -(2’s complement of Temp data) ´ 0.125 °C.
Can anyone point, shout, kick me in the right direction.
My check to see if its negative is
If w0 >= $7FF then negative
I am unsure of where to go from there.
Thanks,
Derek L
Last edited: