Shop OBEX P1 Docs P2 Docs Learn Events
1wirev - what defines the order? — Parallax Forums

1wirev - what defines the order?

AquaaddictAquaaddict Posts: 20
edited 2009-12-24 02:31 in Propeller 1
Hi,

Experimenting with some DS18B20 1Wire temp sensors, I can get them reading ok, but wonder what defines the order in which they are found?

They always seem to be discovered in the same order, so I presume there is some pattern or rule·there?

Am I correct in thinking that I have to hard code their laser ID numbers into my code to make sure I am always reading the right one? The only other way I can think of is to display a list of devices, and thru some menu system record a users choice of what device should be used for what measurement, and then store the laser IDs against their selected usage in·the ROM?

I have also tried the Par version (parasitic verision that takes it power from the data line), it gets dicovered along with the other regular (no Par) ones, and I can get its ID, but I can never get a meaningful temp reading from it, any ideas? I have tridd different values for the pull up, and 3.3v and 5v, always the same problem.

Thanks,

Ants

Comments

  • JonnyMacJonnyMac Posts: 9,208
    edited 2009-12-23 18:19
    You have to apply power (switched on with another pin, see the Maxim docs) for the parasitic units during the temperature conversion -- a bit of a hassle in my opinion, so I use the regular devices.
  • AquaaddictAquaaddict Posts: 20
    edited 2009-12-23 18:24
    Ah ok thanks, that solves the Par issue, I think I will stick with the regualar versions a just use an extra wire.

    Thanks,

    Ants
  • JonnyMacJonnyMac Posts: 9,208
    edited 2009-12-24 02:31
    I don't do a lot of 1-Wire stuff but for a BS2 -> Propeller doc I'm working on I created my own object; it's lean and easy-to-understand. What it doesn't support, however, is auto-ID of OW devices (because I think that's a lot of marketing bunk <wink>).

    obex.parallax.com/objects/491/
Sign In or Register to comment.