london
Offline
Full Member
Karma: 0
Posts: 148
|
 |
« on: July 24, 2007, 04:17:45 pm » |
Hi
I'm trying to get i2c working on an arduino Diecimila.
The board keeps reseting at the point where the code calls Wire.begin
I've stripped out all the code apart from this-
#include <Wire.h>
void setup() { Serial.begin(9600); Serial.println("coming out of reset"); Wire.begin(); } void loop() { Serial.println("in loop"); delay(1000); }
if I comment out the Wire.begin line then the code gets tot the "in loop" print and continues looping, if Wire.begin is in the code then it prints "coming out of resetb" to the serial port (with an extra b in every time) and restarts printing that out every 7 seconds.
Whether the i2c device is connected or not makes no difference, it still behaves the same.
Will try setting it up with another board, but if anyone has any pointers that would be great.
Cheers
Nick
|
|
|
|
|
Logged
|
|
|
|
|
Forum Administrator
Cambridge, MA
Offline
Faraday Member
Karma: 8
Posts: 3532
|
 |
« Reply #1 on: July 24, 2007, 04:24:30 pm » |
I know people have had problems with the wire library in the past. You might try deleting all the .o files in the lib/targets/libraries/Wire subdirectory of the Arduino application directory (including its subdirectories).
When you comment out Wire.begin() do you leave the #include <Wire.h>?
|
|
|
|
|
Logged
|
|
|
|
|
london
Offline
Full Member
Karma: 0
Posts: 148
|
 |
« Reply #2 on: July 24, 2007, 04:26:40 pm » |
Yes the include is still in.
Will try deleting those and report back.
Cheers
Nick
|
|
|
|
|
Logged
|
|
|
|
|
london
Offline
Full Member
Karma: 0
Posts: 148
|
 |
« Reply #3 on: July 24, 2007, 04:35:55 pm » |
Deleting the .o files has worked.
It now goes through to the main loop, and has with other sketches too from the forum too.
Thanks for that.
Now to get the i2c communication actually communicating.
Cheers
Nick
|
|
|
|
|
Logged
|
|
|
|
|
Forum Administrator
Cambridge, MA
Offline
Faraday Member
Karma: 8
Posts: 3532
|
 |
« Reply #4 on: July 24, 2007, 04:45:54 pm » |
Hmm, which version of the Arduino software are you using?
|
|
|
|
|
Logged
|
|
|
|
|
london
Offline
Full Member
Karma: 0
Posts: 148
|
 |
« Reply #5 on: July 25, 2007, 04:42:23 am » |
This machine is still on 007 - I will try 008 and see if that works straight out of the box.
|
|
|
|
|
Logged
|
|
|
|
|
Forum Administrator
Cambridge, MA
Offline
Faraday Member
Karma: 8
Posts: 3532
|
 |
« Reply #6 on: July 25, 2007, 09:04:03 am » |
Awesome, thanks. I think the problem should be fixed in 0008.
|
|
|
|
|
Logged
|
|
|
|
|
london
Offline
Full Member
Karma: 0
Posts: 148
|
 |
« Reply #7 on: July 25, 2007, 04:54:57 pm » |
yep its fine in 008 with no tweaking.
Sorry hadn't realised I hadn't updated the machine I was working on, I would have tried that straight away if i had.
|
|
|
|
|
Logged
|
|
|
|
|
Forum Administrator
Cambridge, MA
Offline
Faraday Member
Karma: 8
Posts: 3532
|
 |
« Reply #8 on: July 25, 2007, 05:09:46 pm » |
Cool, thanks for trying it out.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 3
Arduino rocks
|
 |
« Reply #9 on: August 19, 2007, 03:19:20 pm » |
Thanks! This was happening to me as well. I was totally stumped - until i read this post.
Thanks guys, Mark
|
|
|
|
|
Logged
|
|
|
|
|
Torino, Italy
Offline
Newbie
Karma: 0
Posts: 9
Arduino really rocks
|
 |
« Reply #10 on: August 21, 2007, 04:26:34 pm » |
Finally, were you able, both of you, to drive some I2C devices? I am very interrested in Arduino, but I use I2C quite often for sensors, EEPROMs, devices... I'd really like to know that I can use it.
Thanks
|
|
|
|
|
Logged
|
|
|
|
|
london
Offline
Full Member
Karma: 0
Posts: 148
|
 |
« Reply #11 on: August 27, 2007, 04:09:15 am » |
Yes I got it working fine.
|
|
|
|
|
Logged
|
|
|
|
|
Torino, Italy
Offline
Newbie
Karma: 0
Posts: 9
Arduino really rocks
|
 |
« Reply #12 on: August 27, 2007, 04:24:28 am » |
How could you managed sending some ACK and NotACK "commands" ? Is this automatically done using the Wire Library? I want to use a MCP9803 temperature sensor.
|
|
|
|
|
Logged
|
|
|
|
|
|