Sorry Darrel I mean 18B20
Any code example on how to do this ?
Ok, we'll go the easy way then.
Assuming you're not using the alarms ...HTH,Code:DS18B20_9bit CON %00011111 ; 93.75ms, 0.5°C DS18B20_10bit CON %00111111 ; 187.5ms, 0.25°C <-- My favorite DS18B20_11bit CON %01011111 ; 375ms, 0.125°C DS18B20_12bit CON %01111111 ; 750ms, 0.0625°C (default) OWOUT DQ, 1, [$CC, $4E, 0, 0, DS18B20_10bit]
DT
Thanks Darrel
Would it be possible to share your 9/10bit conversion routine to degrees centigrade
? Walter
The conversion is the same, no matter which resolution you use.
At lower res, the least signifcant bit's become 0's.
<br>
DT
Using the resolution setting would it be possible to make the 18S20 and the 18B20 interchangeable with the same software? I have tried setting the 18B20 to 9 bit and get readings using my 18S20 programming but get some very high temp readings.
Hi, Rich
The 18S20 and 18B20 readings are just different from a shifting value ...
So just you just have to ask the device for the family code ( 10h for S or 28 h for B ) and shift the result the convenient value ...
That's all.
Alain
Hi, Walter
The SEARCH function for "18B20" will give you the routine ...
Alain
Last edited by Acetronics2; - 5th June 2008 at 14:43.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks