Go Down

Topic: i2c causing board to reset (Read 1 time) previous topic - next topic

nick

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


mellis

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>?  

nick

Yes the include is still in.

Will try deleting those and report back.

Cheers

Nick

nick

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

mellis

Hmm, which version of the Arduino software are you using?

nick

This machine is still on 007 - I will try 008 and see if that works straight out of the box.


mellis

Awesome, thanks.  I think the problem should be fixed in 0008.

nick

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.

mellis

Cool, thanks for trying it out.

Mark Holmes

Thanks!
This was happening to me as well.
I was totally stumped - until i read this post.

Thanks guys,
Mark

faquin

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

nick


faquin

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.

Go Up