You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
For sensors we have previously used, for example, MAX30101 (datasheet), the read sequence looks like
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:
send device address in write_mode (LSB=0)
send register address
send device address in read_mode (LSB=1)
read bytes of data sent from the slave
I could not find a API to create the I2C timing diagram we need.
Writing to the register works as expected since it fits the i2c timing diagram as specified in the datasheet
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
The text was updated successfully, but these errors were encountered:
I'm relatively convinced that we need a different implementation of the requestFrom function to be able to read data from the IC. In the absence of this function, I am proceeding with having internal register stated in the driver itself
The I2C protocol for reading registers from the KTD2026 (datasheet) seems to be different from the usual implementation.
![image](https://private-user-images.githubusercontent.com/31810812/389005713-7def2649-d1ee-4472-90d4-74ff61eb6760.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTQ4NTIsIm5iZiI6MTczOTYxNDU1MiwicGF0aCI6Ii8zMTgxMDgxMi8zODkwMDU3MTMtN2RlZjI2NDktZDFlZS00NDcyLTkwZDQtNzRmZjYxZWI2NzYwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDEwMTU1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY5MTkyZTFiOWE1YTY5MzZkOGI3ZjFiODg0MTA2N2I3ZGY5OTNlNmRkYjk2NDhhMjA1YjA5NGYxZmJjODdjOGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Cp36Ag4CyIRAY7cz-cY1ZnuNCECuOqjYm4KeC6xQRAE)
<SEND ADDRESS IN READ MODE> <REGISTER TO READ>
FOLLOWED BY<READ VALUE>
For sensors we have previously used, for example, MAX30101 (datasheet), the read sequence looks like
![image](https://private-user-images.githubusercontent.com/31810812/389006426-4d459f52-9ef0-467a-b8e5-281e9115e72f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTQ4NTIsIm5iZiI6MTczOTYxNDU1MiwicGF0aCI6Ii8zMTgxMDgxMi8zODkwMDY0MjYtNGQ0NTlmNTItOWVmMC00NjdhLWI4ZTUtMjgxZTkxMTVlNzJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDEwMTU1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNlZDBiZTZlYzU0M2NkYmFmYjk3ZTA1YzI4YmM4NDEyODY0ZTIyMTcxZDRmNzU5MzFlYzZiNTU3NDIwYmVhNmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.kx8Rr0boVy0pUQRLWVljFFdGE7rrRQH71s3rE49b_ME)
This I2C sequence can be achieved by the following commands
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:
I could not find a API to create the I2C timing diagram we need.
References:
Logic Analyzer output
The text was updated successfully, but these errors were encountered: