Skip to content
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

Scanner accesses 'reserved' I2C addresses #2

Open
Tech-TX opened this issue Oct 15, 2019 · 0 comments
Open

Scanner accesses 'reserved' I2C addresses #2

Tech-TX opened this issue Oct 15, 2019 · 0 comments

Comments

@Tech-TX
Copy link

Tech-TX commented Oct 15, 2019

From at least rev 2.0 of the spec (I don't have < rev 2), up to current rev 6:
https://www.nxp.com/docs/en/user-guide/UM10204.pdf page 17, 3.1.12 Reserved addresses,
the bottom 8 and top 8 addresses are reserved for special purposes. Following that, line 38 is:

	  for (address = 8; address < 120; address++ )  {

Additionally, for more reliable operation with slow slaves on the ESP8266 using the software wire library, I'd add Wire.setClockStretchLimit(500); or higher just after the Wire.begin(); as the default stretch limit is very short (230uS). I've seen people pushing that up to 1500us for some parts due to the non-static nature of the 8266 wire library. The ESP32 has a different library with a much longer timeout, so it doesn't need this. I've set my code to 1500us default clock stretch limit until I get hold of a fully-static 8266 library done more like the Arduino library.

Just after Wire.begin(portArray[i], portArray[j]); at line 27 add

#ifdef ESP8266
Wire.setClockStretchLimit(500);  //may need to increase this to 1500us for very slow parts
#endif
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

No branches or pull requests

1 participant