spacewrench
New Member
I have a couple of DS18S20s attached to a microcontroller that I plan to use to control a radiant heat system. Right now, they're on about 3" of wire -- I'm just trying to get my software working right. They're wired in powered mode: pin 1 = gnd, pin 2 = 4.7k pull-up to 5v, pin3 = 5v. I wrote code to read and write the OneWire bus, and I can get the serial numbers and read/write the scratchpad memory and EEPROM. If I add another device to the bus, it shows up too, so I think the code is correct.
Unfortunately, when I issue a "Convert Temperature (0x44)" command, I never get a good result -- the scratchpad always says 85 degrees. (Another possible problem is that the "Read Power Supply (0xB4)" command says at least one device is parasite-powered.)
Are there any known issues with the T0-92 sensors running in powered mode? I tried the same sensors in parasite-powered mode (using a different interface and software, so I don't know exactly what it's doing) and they seem to work OK.
Here's a sample session with my code:
Unfortunately, when I issue a "Convert Temperature (0x44)" command, I never get a good result -- the scratchpad always says 85 degrees. (Another possible problem is that the "Read Power Supply (0xB4)" command says at least one device is parasite-powered.)
Are there any known issues with the T0-92 sensors running in powered mode? I tried the same sensors in parasite-powered mode (using a different interface and software, so I don't know exactly what it's doing) and they seem to work OK.
Here's a sample session with my code:
Code:
Demo> ow list
Device 0: 10:06:0a:09:01:08:00:ba
Device 1: 10:17:0d:09:01:08:00:87
2 devices.
Demo> ow read 0
aa 00 00 00 ff ff 0c 10 7f
Temp 85.0°C
Scratch $0000 (High/Low=0°C/0°C)
Demo> ow write 0 257 <<<< write into eeprom
done.
Demo> ow read 0
aa 00 01 01 ff ff 0c 10 85
Temp 85.0°C
Scratch $0101 (High/Low=1°C/1°C)
Demo> ow measure 0
Command sent.
Demo> ow read 0
aa 00 01 01 ff ff 0c 10 85
Temp 85.0°C
Scratch $0101 (High/Low=1°C/1°C)