Go Down

Topic: I2C read problems (Read 7327 times) previous topic - next topic

herctrap

as before i changed the

#define BUFFER_LENGTH 128

into wire.h

and

  #define TWI_BUFFER_LENGTH 128

into twi.h

from 32 to 128

Nick Gammon

I changed both of those, and ran this sketch:

Code: [Select]
#include <Wire.h>

void setup ()
  {
  Wire.begin ();
  }

void loop () 
  {
  Wire.beginTransmission (25);
  Wire.write ("AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789000987654321");
  Wire.endTransmission ();
  delay (1000);
  }


All the bytes were sent (I could see with the logic analyzer). I also had to recompile and re-upload the receiving Arduino as well.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

herctrap


herctrap

also the slave is a custom board
and i am using Arduino Pro at 8Mhz because Atmega328 on a breadboard isnt working any more on Arduino 1.0


herctrap


herctrap

Code: [Select]

#include <Wire.h>

void setup ()
  {
  Wire.begin ();
  }

void loop () 
  {
  Wire.beginTransmission (25);
  Wire.write ("AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789000987654321");
  Wire.endTransmission ();
  delay (1000);
  }


on the 8Mhz board


herctrap

also i get the same output from an atmega1280 at 16Mhz

herctrap

and from an arduino uno board

Nick Gammon

These pictures don't show much. They show about one byte, and you are trying to send around 72.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

herctrap

i dont have a logic analyzer yet

can you please send me your files to test

thanks a lot

herctrap

i made it

i re-downloded the arduino 1.0
unzip it in dekstop
change the files in dekstop
and then replace it in Programm files

thanks a lot

Go Up