PDA

View Full Version : DS1820 resolution



RFsolution
- 13th December 2007, 19:34
Hi

If I understand well it should be possible to lower the resolution of the DS1820
in order to speed-up the conversion time ?

As I want to use several DS1820's and return there value on a HSERIN request
this migh be a possibility

Further I dont need more than 1 or 0.5 deg resolution

Any one succeed in changing the resolution ?

Walter

Darrel Taylor
- 13th December 2007, 20:16
You can change the resolution of the DS18B20, but not the older DS1820.

And yup, it goes much faster.
<br>

RFsolution
- 13th December 2007, 21:21
Sorry Darrel I mean 18B20

Any code example on how to do this ?

Darrel Taylor
- 13th December 2007, 21:31
I do.

Do you feel like beta testing something?
<br>

Darrel Taylor
- 13th December 2007, 23:48
Ok, we'll go the easy way then.

Assuming you're not using the alarms ...


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]


HTH,

RFsolution
- 14th December 2007, 11:25
Thanks Darrel

Would it be possible to share your 9/10bit conversion routine to degrees centigrade
? Walter

Darrel Taylor
- 14th December 2007, 13:03
The conversion is the same, no matter which resolution you use.

At lower res, the least signifcant bit's become 0's.
<br>

RichG
- 5th June 2008, 13:52
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.

Acetronics2
- 5th June 2008, 14:41
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