energia / msp432-core

MSP432 Core and Framework
14 stars 10 forks source link

Wire master read Wire.available fails if delay of >= 500 is inserted #36

Closed robertinant closed 7 years ago

robertinant commented 7 years ago

The following Sketch prints garbage. If the delay is changed to 400 ms, the Sketch behaves as expected.

#include <Wire.h>

void setup()
{
  Wire.begin();        // join i2c bus (address optional for master)
  Serial.begin(115200);  // start serial for output
}

void loop()
{
  Wire.requestFrom(4, 6);    // request 6 bytes from slave device #2

  while(Wire.available())    // slave may send less than requested
  {
    char c = Wire.read(); // receive a byte as character
    Serial.print(c);         // print the character
  }
  Serial.println();
  delay(450);
}
robertinant commented 7 years ago

Resolved and will be available in the next release.