PDA

View Full Version : 1wirev - what defines the order?



Aquaaddict
12-24-2009, 12:56 AM
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

JonnyMac
12-24-2009, 01:19 AM
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.

Aquaaddict
12-24-2009, 01:24 AM
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

JonnyMac
12-24-2009, 09:31 AM
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/ (http://obex.parallax.com/objects/491/)