Skip to content

Issues reading register contents from the IC #2

@nitin710

Description

@nitin710

The I2C protocol for reading registers from the KTD2026 (datasheet) seems to be different from the usual implementation.
<SEND ADDRESS IN READ MODE> <REGISTER TO READ> FOLLOWED BY <READ VALUE>
image


For sensors we have previously used, for example, MAX30101 (datasheet), the read sequence looks like
image

This I2C sequence can be achieved by the following commands

_i2c->beginTransmission(_address);
_i2c->write(reg);       // Register address
_i2c->endTransmission();
_i2c->requestFrom(_address, 1); // request 1 byter of data
_i2c->read();

However, there seems to be no support in the Wire library to send <SEND ADDRESS IN READ MODE> <REGISTER TO READ>.
I think the intended use of the Wire library to read a register is:

  1. send device address in write_mode (LSB=0)
  2. send register address
  3. send device address in read_mode (LSB=1)
  4. read bytes of data sent from the slave
    I could not find a API to create the I2C timing diagram we need.

References:

  1. Understanding the I2C Bus
  2. I2C - - — Arduino ESP32 latest documentation
  3. Wire | Arduino Documentation
  4. Read KTD2026 registers without tx command - Nordic Q&A - Nordic DevZone - Nordic DevZone

Logic Analyzer output

  • Using the logic analyzer, you can confirm that
    1. Writing to the register works as expected since it fits the i2c timing diagram as specified in the datasheet
    2. However, reading a register usinghte Wire library implementation goes against the KTD2026 datasheet, and hence, we are unable to read a register from the IC
      image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions