Go Down

Topic: Introducing Maxim DS2482 1-wire master library (2) (Read 1 time) previous topic - next topic



Since I can't post to the earlier thread (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1242137666),
I've taken the liberty of creating a second follow-on thread.

Thank you for creating the DS2482 library and to Don T for his efforts to debug the wireSearch function. However, Don's mod didn't get it completely fixed.  I have a 1-wire network that includes devices with Family Codes 0xFF, 0x12, and 0x10.  Search finds only the 0x12 and 0x10 devices.  If I remove those devices, then search finds the 0xFF device.

After much head-scratching, I have determined that the following modifications will make search work properly.  (See Maxim Application Note 187.)

In DS2482.h:
106c106         (Reverse Don's mod)
<    int8_t searchLastDisrepancy;
>    uint8_t searchLastDisrepancy;

In DS2482.ccp:
233,234c233   (Reverse remainder of Don's mod)
<    // Initialize to negative value
<    searchLastDisrepancy = -1;
>    searchLastDisrepancy = 0;
<    for(i=0;i<64;i++)
>    for(i=1;i<65;i++)
<       int romByte = i/8;
<       int romBit = 1<<(i&7);
>       int romByte = (i-1)>>3;
>       int romBit = 1<<((i-1)&7);

Don's mod didn't succeed since the loop index "i" is used by searchLastDisrepancy AND last_zero.

Perhaps you'd like to add these modifications to your source at (https://github.com/paeaetech/paeae/tree/master/Libraries/ds2482/).

Could you also take that opportunity to add the modification from Mike Jackson at (http://arduino.cc/forum/index.php?topic=37647.0) and correct the spelling of "discrepancy".




I would like to use this library reading a couple DS1822 thermometersa but am having a hell of a time getting it to talk to me.
I can see the reset is working.
Anybody have or know where on this forum there is/are some more sample code that gets data off a sensor using the ds2482?
Thanks in advance.
Love you guys.


The problem may be solved already ....

But it may help:


This library contains a lot of working drivers including the DS2482.

The source contains lots of comments, there is an faily good documentation AND it simply works as expected!

The Design of the libraries was also made with respect to error handling ;-)

Go Up