1-wire Problem - Reading a specific Address
bdickens
Posts: 110
I've got a program that is reading a couple of 1-wire sensors. Ultimately, there will be 8 on the line, but I've only got 2 connected for now. Using a lot of different code sources, I've got a program that does most of what I want with 1 major obstacle (and a nit)
I will have 4 temperature sensors. So I need to be able to store their results in the correct bucket (airtemp, watertemp etc). I can't seem to get MATCHROM to work. Micah Dowty's seems to work but I can't replicate it.
Code included and at the end are the PST output so you can see it with addr (micah style) and RevAddr (lsb corrected). The routine that is the issue is GETDATA. The first parts all seem to work correctly.
(the nit is the ugly 64bit comparison which surely can't be the best way to do this)
Thanks
I will have 4 temperature sensors. So I need to be able to store their results in the correct bucket (airtemp, watertemp etc). I can't seem to get MATCHROM to work. Micah Dowty's seems to work but I can't replicate it.
Code included and at the end are the PST output so you can see it with addr (micah style) and RevAddr (lsb corrected). The routine that is the issue is GETDATA. The first parts all seem to work correctly.
(the nit is the ugly 64bit comparison which surely can't be the best way to do this)
Thanks
Comments
The iButton and other slave units seem to work well with micro-controllers when one is attached. But as you start to add more and more, the requirements for timing become tighter and tighter. It seems that you end up having to use their driver chips to get larger networks running right.
Reading the specific address is a general indicator of the networks good health. With the CRC function, it confirms that all units are happily on line. Other functions may seem to work, but be sending errors that you have no basis to question.
I have a TINI400 board from Dallas Semi that uses their drivers and works fine with 1-wire networks (because they built it themselves with their drivers). But it programs in a subset of Java and that is a whole additional learning curve.
Also, the 1-wire network generally works well with +5 volts, being driven at 3.3 volts has a reputation for marginal results.
The part thats funny is that if I run Jon McPhalen's 1-wire or anyone elses, the devices respond to a read but they both work with one device (except Micah Dowty) so I'm obviously down to something I am not putting on the network correctly.
Thanks
If you are using the temperature 1-wire devices, there are two options to power the slaves. And the documentation for active pull-up circuits have been revised and revised again to the point that I've no idea which examples would really work - other than using their in-house driver/master chips (which are the late-comers to fix problems).
I've done a lot of reading at there website and others in consideration of using 1-wire networks in greenhouses and pig farms. Unless you are knowledgeable (and equipped) in wire network impedance matching (something that is usually applied to coax cable networks and antenna feeds), it just seems easiest to use their chips and keep the networks close to their ideal configurations.
On the internet there is a huge divide between those that love 1-wire and have had excellent results and those that curse the day they tried them. I suspect that those without the equipment and education to make long wire networks work form the latter.
Thanks
Thanks for posting that.