nox771 / i2c_t3

Enhanced I2C library for Teensy 3.x devices
156 stars 44 forks source link

9.2+ LAST BYTE TWICE #13

Closed TechMasterJoe closed 6 years ago

TechMasterJoe commented 6 years ago

has something to do with the ftl change 9.2+ gets LAST BYTE TWICE

nox771 commented 6 years ago

Argh. I'll take a look at this tonight. So the bug is last byte is repeated? I'm guessing this is on LC/3.5/3.6 slave?

TechMasterJoe commented 6 years ago

3.6 tested also on logic peek I have a teensy 3.6 as a slave and master it gets data from a pi as slave (wire1) writes to an array and the array is sent out as master (wire) sending data seams to wait tell a 2nd command comes in ex: delay

i get 4 byte packet 1 add:reg:reg:data on wire1 send data to wire0 and the data wont send tell packet 2 comes in this lib v9.0

void PiReceive0(size_t count) {
  for(uint8_t i = 0; i < count; i++){
    ReceiveBuffer_0[i] = Wire1.readByte();
  }
  Wire.pinConfigure(I2C_PINS_18_19, I2C_PULLUP_EXT);
  Wire.beginTransmission(ADDRESS);
  for(uint8_t i = 0; i < count; i++){
    Wire.write(ReceiveBuffer_0[i]);
  }
  Wire.endTransmission();
}

20 MHz, 1 B Samples .zip this is a saleae logic probe file showing the V9.3 error i can retest as much as you like also if you can help with my I2C piggyback setup reachout to me TechMasterJoe at gmail no worries all help is compensated and no games time cost money

nox771 commented 6 years ago

For the record - this issue was resolved over email exchange. There were two issues:

  1. Slave ISR on LC/3.5/3.6 was not correctly detecting RepSTART
  2. Nested Wire calls (eg. calling Wire inside Wire1 ISR) was not working correctly

Both of these issues are fixed in newest v9.4 release.