I need to read the temperature and I do not like to re-invent the wheel so, not the cheapest way, I ordered a DS18B20 from Mouser.
The 08M2 circuit is simple, + to +5v, DQ to leg5 (C.2) with a 4k7 pullup to +5v, GND to 0v.
The code is:
main:
readtemp12 c.2,w1
debug
goto main
The data pin idles high, then goes low for 500us then considerable activity for about 10ms then high again. the debug screen shows w1 with 1360 in it. No matter how I change the temperature of the device, the 1360 number does not change. I swapped it for an identical part bought at the same time, no difference. Have I ordered the wrong device? The part number is a Dallas DS18B20P.
The 08M2 circuit is simple, + to +5v, DQ to leg5 (C.2) with a 4k7 pullup to +5v, GND to 0v.
The code is:
main:
readtemp12 c.2,w1
debug
goto main
The data pin idles high, then goes low for 500us then considerable activity for about 10ms then high again. the debug screen shows w1 with 1360 in it. No matter how I change the temperature of the device, the 1360 number does not change. I swapped it for an identical part bought at the same time, no difference. Have I ordered the wrong device? The part number is a Dallas DS18B20P.