OneWire Library / DS1990A

<note: I had a bunch of links in this to make it easier for reference, but apparently I have to have 1 post before I can add links… :-? I’ll try to add them in a reply.>

Hi, all. I’m reasonably new to the Arduino, and I’m having a smidge of trouble with the OneWire library.

I’ve grabbed the most recent copy of Jim Studt’s OneWire Library and dumped it in my ./hardware/libraries/ directory. It comes up fine in Arduino.

I attached my button reader to pin 10 as specified with a 4.7k pull-up resistor, and the ground pin to (duh) the Arduino ground.

I then copied the first example from the Playground’s OneWire page, verified, and uploaded it. I should note I commented out the following line so I didn’t get spammed so badly:

      Serial.print("No more addresses.\n");

I started up the serial monitor, and was greeted with this lovely piece of work:

R=0 0 0 0 0 0 0 40 CRC is not valid!
R=0 0 0 0 0 0 0 C0 CRC is not valid!
R=0 0 0 0 0 0 0 40 CRC is not valid!
R=0 0 0 0 0 0 0 C0 CRC is not valid!
R=0 0 0 0 0 0 0 40 CRC is not valid!
R=0 0 0 0 0 0 0 C0 CRC is not valid!
R=0 0 0 0 0 0 0 40 CRC is not valid!
R=0 0 0 0 0 0 0 0 Device is not a DS18S20 family device.
R=0 0 0 0 0 0 0 0 Device is not a DS18S20 family device.
R=0 0 0 0 0 0 0 80 CRC is not valid!
R=0 0 0 0 0 0 0 40 CRC is not valid!
R=0 0 0 0 0 0 0 C0 CRC is not valid!
R=0 0 0 0 0 0 0 40 CRC is not valid!
R=0 0 0 0 0 0 0 C0 CRC is not valid!
R=0 0 0 0 0 0 0 40 CRC is not valid!
R=0 0 0 0 0 0 0 C0 CRC is not valid!

It appears to be reading something from nothing. My contact reader is nothing but a pair of metal contacts much like the DS9092, so unless there’s a button on the contacts nothing should be read.

The two lines in the middle are when I press and hold my iButton DS1990A on the contact. As you can see, it’s reading a zeroed address family, id, and crc, which is… useless. :stuck_out_tongue:

I’ve read some other threads, and the closest thing I found to this problem involved removing the OneWire.o file and letting Arduino recompile that. That fixed their error, but alas, not mine.

Any help would be greatly appreciated. Thanks :slight_smile:

Here are those links I mentioned:

Jim Studt's OneWire Library

The Playground's OneWire page

The DS9092

The other thread

I should also mention I have an Arduino Duemilanouve with an ATMega 328, running v15 under Ubuntu 9.04 (Jaunty). I have successfully used the Arduino for a number of other test projects so far.

I've just tried running the same OneWire library under the Arduino IDE v13 and I had the same problem. I then tried under v12, but the Duemilanove/ATMega328 isn't supported by v12. Any help or advice would be highly appreciated.

[edit]Problem solved. As I thought, it was something very minor (but highly important!) The terminals on the button reader apparatus are beneath plastic. I had swapped the wires to make sure that wasn't the problem, however I neglected to swap the pullup resistor in the process... ::)

Seeing

R=1 4 D1 9A 12 0 0 8D Device is not a DS18S20 family device.

makes me very happy. Cheers![/edit]

Thanks for the help this post helped me alot :)