Help with reading 1-wire devices
Franklin
Posts: 4,747
I'm using the code from the BSP documents to read a DS18S20 temperature device and am getting "170" and 85C which are the power on reset values. I've tried the 18S20 on another device and it reads correctly. I have a 4.4K resistor from DQ to VDD and in my case DQ and V+ are tied together at the device (for parasitic power). Any thoughts?
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Post Edited (Franklin) : 4/1/2007 5:47:04 PM GMT
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Post Edited (Franklin) : 4/1/2007 5:47:04 PM GMT
bsp
2K
Comments
I'd recommend changing the PAUSE 25 to something more like PAUSE 750 and
remove the code that checks the temperature against zero. I believe that as
soon as you send that OWIN command to read the temperature you cause the
temperature conversion to abort. Keep in mind that the 18S20 requires something
on the order of 750-milliseconds to complete the temperature conversion!
Alas, the DQ pin should be connected directly to the appropriate pin on your BS2p
and tied to Vdd through a resistor. Your 4.4K should be OK although Maxim/DalSemi
recommends 4.7K. If DQ is tied directly to V+ without the resistor then you'll never
get any commands into nor data out of the 18S20.
The Vdd and GND pins on your 18S20 should be tied together and connected to your
circuit ground in order to use parasitic power.
Have a good look at the datasheet from Maxim/DalSemi at
datasheets.maxim-ic.com/en/ds/DS18S20.pdf with regards to wiring the 18S20.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rusty-
--
Rusty Haddock = KD4WLZ = rusty@fe2o3.lonestar.org
**Out yonder in the Van Alstyne (TX) Metropolitan Area**
Microsoft is to software what McDonalds is to gourmet cooking
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen