espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.68k stars 7.42k forks source link

Receive error occurs at I2C port #1998

Closed Schrscat closed 5 years ago

Schrscat commented 6 years ago

We are using the ESP32 to receive the information from the MAX 30100. The returned value on the oscilloscope is right, which means that the value returned by the sensor is right. The value is 0x11. But received value from the esp32, showing on the PC, is not 0x11 but 0. Following is the shortest code to generate this error. This error could be a generous one. We have tried all the I2C ports, but this problem remains the same.

uint16_t readRegister(uint8_t address)
{
    Wire.beginTransmission(MAX30100_I2C_ADDRESS);
    Wire.write(address);
    Wire.endTransmission(false);
    Serial.print("byte count: ");
    Serial.println(Wire.requestFrom(MAX30100_I2C_ADDRESS, 1));

    return Wire.read();
}

void setup(){
    Serial.begin(115200);

    delay(1000);

    Wire.begin(21,22);
    Wire.setClock(I2C_BUS_SPEED);

    Serial.println(readRegister(0xff));
}

void loop(){}

The picture on the oscilloscope is

qq 20181024220001

lbernstone commented 6 years ago

Please indicate which version of code you are using. There were some issues with ReSTART in the release version. This is fixed in the repository.

stickbreaker commented 6 years ago

@schrscat same issue as #1962.

Chuck.

Schrscat commented 6 years ago

Please indicate which version of code you are using. There were some issues with ReSTART in the release version. This is fixed in the repository.

We are using v3.2-dev-39-gaaf12390.

Schrscat commented 6 years ago

@Schrscat same issue as #1962.

Chuck.

OK,we will try this. I would reply to you asap

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This stale issue has been automatically closed. Thank you for your contributions.