Hi,
I wanted to know if the code is correct for 10-bit
Get_temp:
OWOUT DQ,1,[$CC, $44] ' Skip ROM search & do temp conversion
pause 188 ' Conversion time for 10 bit reading
OWOUT DQ,1,[$CC, $BE] ' Skip ROM search & read scratchpad memory
OWIN DQ,2,[TempR.Lowbyte,TempR.Highbyte]' Read two bytes / end comms
Convert_Temp:
TempC = DIV32 10 ' Use Div32 value to calculate precise deg C
TempC = (TempR & $0FF0) >> 4 ' Mask middle 8-bits, shift into lower byte
Float = ((TempR.Lowbyte & $0F) * 25) ' Lower 4-bits of result * 25
I have some doubts on the quantization:
for 12 bit 750.0mS 0.0625C 1/16 degree so lower 4-bits of result *625
for 10 bit 187.5mS 0.25C 1/4 degree the lower 4-bits of result *25?
Thank you
Bookmarks