Hi, I have read a lot of useful information on this forum, and it has all helped me in creating my first project. http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1217730619/15#15
Now, I need your help figuring out this little problem im having with I2C. I will mention that I am successfully using two devices on the I2C bus and it is working perfectly on the rover, a wii nunchuck and an ultrasonic sensor. I am now interested in adding a second atmega168, eventually standalone, but for now on another iDuino board, and I wish to communicate via I2C between the two atmegas.
I have it all wired up, with a shared ground between the two iDuinos and SDA and SCL connected together on both, and I am successfully receiving data from the rover's main iDuino as a I2C master on the I2C slave iDuino, viewing the data by printing it to serial. So this part is good, no problems here at all. However, the problem is now my wii nunchuck data becomes corrupt, the rover will not even start up because I cannot read the buttons and the gyro data is all wrong. The code I am using is straight from the master_writer and slave_receiver examples in the Wire library...and I am simply sending one byte to the slave at a time.
Has anyone ever run into this kind of problem with adding a new slave device to the I2C bus? Or with connecting two atmegas together along with other devices on the bus?
One thing I was wondering is do I have to share the resonator/crystal for this to work? I have seen this approach mentioned here http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1205243372/0
Thanks for any insight you can provide.