Skip to content

I2C Slave Regression #1051

Open
Open
@Ruggero-R

Description

@Ruggero-R

Trying a master_reader/slave_sender on two gigas with Core 4.2.4 gives NACK 2 out of 3 times.

To test it:
1 giga with

#include <Wire.h>

void setup() {
  Wire1.begin();        // join I2C bus (address optional for master)
  Serial.begin(9600);  // start serial for output
}

void loop() {
  Wire1.requestFrom(16, 6);    // request 6 bytes from slave device #8

  while (Wire1.available()) { // slave may send less than requested
    Serial.write(Wire1.read());         // print the character
  }
  Serial.println();
  delay(500);
}

1 giga with:

#include <Wire.h>

void setup() {
  Wire1.begin(16);                // join I2C bus with address #8
  Wire1.onRequest(requestEvent); // register event
}

void loop() {
  delay(1);
}

// function that executes whenever data is requested by master
// this function is registered as an event, see setup()
void requestEvent() {
  Wire1.write("hello "); // respond with message of 6 bytes
  // as expected by master
}

SCL1 to SCL1
SDA1 to SDA1
GND to GND

Works perfectly with core 4.2.1

@facchinm @pennam

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions