I2C read problems

What files did you change exactly?

wire.h and twi.h into the library folder

herctrap:
but it didn't worked

Can you be a bit more specific? What didn't work? Under version 1.0 you would have had to change other things too.

The master

asks for data

void Read_Data()
{
  Wire.beginTransmission(2);
  Wire.write('H');
  Wire.endTransmission();

  delay(200);

  Wire.beginTransmission(2);
  Wire.requestFrom(2,127);
  Wire.endTransmission();
  for ( int i=0; i<128; i++ ) Serial.write(Wire.read());
  Serial.println("");
}

and on the slave

  Wire.begin(I2C_Address);  
  Wire.onRequest(requestEvent); 
  Wire.onReceive(ReceiveCommand);
void ReceiveCommand(int howMany)
{
  command = Wire.read();
}
void loop()
{
  if (command == 'H')
  {
    Capture_OS4000();
    command = 'N';
  }
}
void  Capture_OS4000()
{
  //Serial.println("mpika capture"); // debug
  //Serial.flush();
  while ( Serial.read () != '
void requestEvent()
{
  //Wire.write (OS4000Data, 127);
   Wire.write ("AbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789000987654321");
}

but i am receiving

AbcdefghijklmnopqrstuvwxyzABCDEFÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ

thanks

);
 //Serial.flush();
 while( Serial.available() < 127 );
 OS4000Data[0] = '


§DISCOURSE_HOISTED_CODE_5§


but i am receiving 

AbcdefghijklmnopqrstuvwxyzABCDEFÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ

thanks 

;
  for(Position=1; Position<128; Position++){
    buf = Serial.read();
    if ( buf == '*' ) EOL = Position + 2;
    if ( Position <= EOL ) OS4000Data[Position] = buf; 
    else OS4000Data[Position] = B0;
  }
}
§_DISCOURSE_HOISTED_CODE_5_§

but i am receiving

AbcdefghijklmnopqrstuvwxyzABCDEFÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ

thanks

herctrap:
wire.h and twi.h into the library folder

In my copy they are in the Wire and Wire/utility folder.

yes in these folders

if you make it work can you send me the files please
because I edit it with wordpad

thanks a lot

I'm not going to make it work and send it to you. Edit two files and change 2 numbers. At least show here what changes you made.

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

I changed both of those, and ran this sketch:

#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.

give me 4minutes

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

and after a while

#include <Wire.h>

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

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

on the 8Mhz board

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

and from an arduino uno board

These pictures don't show much. They show about one byte, and you are trying to send around 72.

i dont have a logic analyzer yet

can you please send me your files to test

thanks a lot

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