Shop OBEX P1 Docs P2 Docs Learn Events
C code for DS18B20 — Parallax Forums

C code for DS18B20

RsadeikaRsadeika Posts: 3,837
edited 2015-06-23 09:48 in Propeller 1
I need to have an informative discussion about this. Basically for my QS/RPi project I want to add some of these temperature sensor probes, has anybody worked with this? I went to ebay and I noticed most of these probes are listed as 1 meter in length, not sure if they come in longer lengths, but for my setup I will probably need 10 foot length. They will all be on one buss so I am not sure how or should they have there own power supply? Any other pertinent information would be appreciated.

Below I attached the existing C code that I found in the OBEX, their is a discussion about one buss and multiple buss configurations, not sure what to make of that information.

Thanks

Ray

Comments

  • JonnyMacJonnyMac Posts: 9,105
    edited 2015-06-23 09:08
    For a buss that long you'll probably want to use a 5v supply, and use a fairly stiff pull-up (3.3K) to 5v. Whatever code you use, make sure that the DQ pin is floated to provide a "1" and pulled low for "0." I can't offer more than that; my own driver is in PASM with a Spin interface. That said, it does use a mailbox style interface to the PASM, so it should be transportable to C.
  • RsadeikaRsadeika Posts: 3,837
    edited 2015-06-23 09:31
    Thanks Jon for the information, what I might do is run your Spin program through the spin2cpp converter and see what I get, not sure about the functionality of the result though.

    Ray
  • JonnyMacJonnyMac Posts: 9,105
    edited 2015-06-23 09:48
    Dave Hein ported my WS2812 code (Spin + PASM) to C; he might be helpful in porting this. The timing in my code is based on meeting with engineers at Dallas/Maxim when I worked for Parallax.
Sign In or Register to comment.