Hello,
I'm developing a serial communication bus via I2C between a teensy 3.6 acting as the master and some device acting as slaves.
The payload of each frame is 3 bytes for MIDI data exchange (so one status byte and 2 data bytes).

When the teensy starts a communication in writing everything works fine.

That's the code:

Code:
void myPitchChange(byte channel, int pitch)
{
  int normalizedValue = pitch + 8192;

  byte toSend[2];
  toSend[0] = (normalizedValue >> 7) & 0x7F;
  toSend[1] = normalizedValue & 0x7F;
  
  Wire.beginTransmission(SLAVE_ADDRESS);
  Wire.write(toSend[0]);
  Wire.write(toSend[1]);
  Wire.endTransmission();
}
When it goes in reading the bytes looses synch and over 3 frames (so 9 bytes) the status byte, that should be the first byte in the frame, is instead at the first place inside the first frame (that's correct), at the third place inside the second frame and in the second place inside the third frame.

That's the code:

Code:
  Wire.requestFrom(SLAVE_ADDRESS, 3);


  byte b[3];
  while(Wire.available())
  {
        b[0] = Wire.read();
        b[1] = Wire.read();
        b[2] = Wire.read();
  }
This is what i have captured with my oscilloscope.

Click image for larger version. 

Name:	20200301_104351951_iOS.jpg 
Views:	23 
Size:	147.5 KB 
ID:	19241

Click image for larger version. 

Name:	20200301_104733748_iOS.jpg 
Views:	32 
Size:	159.6 KB 
ID:	19242

In the first image you can see the status byte moving around inside the frames "clockwise".
In the second i highlighted a question mark shown by the logic decoder of the oscilloscope. I understand this is at the end of the frame and maybe it's just the way my rigol tells about the nack to close the frame, but i'm not sure.

Below the detail where the question mark happens.

Click image for larger version. 

Name:	20200301_110151974_iOS.jpg 
Views:	15 
Size:	141.9 KB 
ID:	19243

Is there someone with some idea of what's going on?

I think you all for any suggestion.

Filo