Go Down

Topic: Wire and OneWire conflicts? (Read 2 times) previous topic - next topic

Josh

All, any status on these issues?  I have the exact same problems.  I have the DS1337 working great as my clock, a PCF8457 as an IO expander - all on I2C working fine.  I also tried the DS1631 temp sensor and the 24LC256 which both dont work as you describe (always just returns whatever is in the buffer).  I have looked through the TwoWire code and TWI from wiring and I cant find anything wrong yet.  I'll let you all know if I find anything, but was wondering if you all had found anything yet.

bdmatic

I just received my 1631's today and will do some fiddling. Doesn't sound promising, though.  Drd, if you have made any modifications to files from the avrlib, such as i2c.c  i2ceeprom.c  ds1631.c i2csw.c to get them to work or partly work on arduino I'd really love to get copies posted in the playground, even if incomplete to have something further to fiddle with.  
Anyone else have an idea how tricky it is to port things from avrlib?

Thanks!

Josh

Ok, an update.  Just get the address correct and I'm betting it will work.  See the last page of this thread:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1170973485/30

I have not re-tried my DS1631 yet, but I bet I can get it to work now if needed.

-- Josh

bdmatic

Just tried the 24lc256 with the address of 0x50 for both the wire.beginTransmission and wire.endTransmission statements and it works!  Can read and write to arbitrary locations and the data is still there after a reset.

Thanks to you and drd for this clever diagnosing.

In retrospect there's something in the wire library documentation stating that address is a value from 0 to 127 implying the 7-bit address, but it doesn't mention that wire sets the read/write bit itself in any of the online docs.

I'm going to set up a 1631 now.

Also, there still seems to be the problem with wire and oneWire coexisting in the same sketch.

Josh

Glad to hear it is working for you now as well.  I had some problems with both Wire.h and OneWire.h for a while, but I trimmed out my code and removed some Serial.print and Serial.println I had interspersed and it cleared it up and the problem went away.  Makes me think there may be a third component of the problem involving Serial and possibly timing or interrupts.  Since mine has started working fine now, I cant find the problem.  Good luck on your work, and let us know if the 1631 works fine as well.

-- Josh

Go Up