Shop OBEX P1 Docs P2 Docs Learn Events
Help with reading 1-wire devices — Parallax Forums

Help with reading 1-wire devices

FranklinFranklin Posts: 4,747
edited 2007-04-03 01:02 in BASIC Stamp
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

Comments

  • Fe2o3FishFe2o3Fish Posts: 170
    edited 2007-04-02 07:47
    Stephen,

    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
  • FranklinFranklin Posts: 4,747
    edited 2007-04-03 01:02
    Thanks Rusty, I had it tied correctly in real life, it's in my mind it was backwards. The changing to 750 did the trick (I tried 500 and it was still too fast) I think the part about checking for 0 would work if the chip were powered. I'm trying to simplify my weather reporting. Right now I'm running a Dallas 1-wire weather station through a TAPR T238 into a BS2 and out to a siteplayer. There are just too many steps/connections.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.