Well, my first instinct is to say "Don't Do It".... can you point me out how to read 2 sensors on 1 bus ...
The overhead involved, is HUGE.
You'll end up using 2-3K words of program space just doing the SearchRom, saving the serial number to RAM/EEPROM, then sending those serial numbers each and every time you access either one of the sensors.
It's so much easier to just use another pin.
And with separate pins, the program automatically knows which sensor it's talking too.
With multiple devices on a single buss, there's no easy way to tell which sensor is in which location (without human intervention).
But with that said, if you only have the one pin available?
Here's where you need to start ...
1 Wire Search Routine (Dave)
http://www.picbasic.co.uk/forum/showthread.php?t=520
Dallas 1-wire search Routine (jimbab)
http://www.picbasic.co.uk/forum/showthread.php?t=3671
Bookmarks