PDA

View Full Version : DS18B20-Resolution change. How?



Ioannis
- 4th December 2012, 21:45
How can we change the resolution of the DS18B20?

I tried this in vein:



OWOut DQ, 0, [$CC,$4E, $00,$00,$3F]' set to 10bits
owout DQ,0,[$BE]
OWIN DQ, 0, [STR ID\9]


It returns only $FF, like there is no device connected.

The DS18B20 is confirmed to work OK.

Ioannis

Darrel Taylor
- 4th December 2012, 22:33
The command to set the resolution is OK, as long as you're not using the alarms.

But you need to do a SkipROM before the Read_Scratchpad.
And the reset modes should be different.

OWOut DQ, 1, [$CC, $4E, $00,$00,$3F]' set to 10bits
; Convert and wait here
owout DQ, 1, [$CC, $BE]
OWIN DQ, 2, [STR ID\9]

Ioannis
- 5th December 2012, 17:32
I mis-understood the reset pulse. Thought that if the device was set, say for 10 bits, and then a reset pulse was sent, it would set it again at the default 12 bit state.

Thanks Darrel, is OK now.
Ioannis