Skip to content

NACK last byte when read #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2015
Merged

NACK last byte when read #554

merged 1 commit into from
Jul 16, 2015

Conversation

bbx10
Copy link
Contributor

@bbx10 bbx10 commented Jul 15, 2015

The TCS34725 RGB color sensor works reliably with this change. See #535 for details.

The TCS34725 RGB color sensor works reliably with this change. See #535 for details.
@me-no-dev
Copy link
Collaborator

have you tested this with other i2C devices?

@bbx10
Copy link
Contributor Author

bbx10 commented Jul 15, 2015

Yes, a 9DOF IMU board which was not working now works with this change and the clock stretch increase (#553). This change might help with the other IMU board (#526).

I will test 4 other i2c devices with this change and #553 tomorrow.

I am using the following for the i2c protocol reference:
http://www.nxp.com/documents/user_manual/UM10204.pdf.

Section 3.1.6 talks about 5 conditions for generating NACK. The last one says

  1. A master-receiver must signal the end of the transfer to the slave transmitter.

This is why the Uno/AVR generates NACK after the last byte read.

@igrr
Copy link
Member

igrr commented Jul 15, 2015

We used to have this correct long long time ago :)

I will also test a few more devices myself with this change and #553.

@bbx10
Copy link
Contributor Author

bbx10 commented Jul 15, 2015

We used to have this correct long long time ago :)

Thanks, this helps assure me this is a good change. The change affects every i2c read so it has the potential for massive breakage. :(

The 9DOF IMU ran for 3 hours and was still reporting correct values. The i2c chips on board are the L3GD20H and LSM303.

The following other i2c devices work. Only a few minutes testing done per device.
BMP180, HTU21DF, ISL29125, TSL2591, TCS34725

All but the TCS34725 worked even without this change. All testing was done with #553 as well as this change.

@igrr
Copy link
Member

igrr commented Jul 16, 2015

I have tested this change with MPR121, HMC6352, and one I2C EEPROM (forgot the part name).
All seem to be work fine.

igrr added a commit that referenced this pull request Jul 16, 2015
@igrr igrr merged commit c7a46bc into esp8266:esp8266 Jul 16, 2015
@bbx10 bbx10 deleted the tcs34725_patch branch July 16, 2015 20:26
igrr added a commit that referenced this pull request Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants