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

Clock Stretching Causes I2C bus to hang #1

Closed
richteel opened this issue Mar 19, 2016 · 1 comment
Closed

Clock Stretching Causes I2C bus to hang #1

richteel opened this issue Mar 19, 2016 · 1 comment

Comments

@richteel
Copy link
Collaborator

The bug is in the hardware of the Raspberry Pi. (See Raspberry Pi I2C clock-stretching bug for more information.)

A recomendation is to use the PiGPIO library to bit bang the I2C bus.

A C project was found which uses the PiGPIO library. This C project should provide a good start.

Steps to reproduce with current code base (18 March 2016)

  • Currently if only one device is connected the code runs fine. In order to see this issue in action, connect at least two devices to the I2C bus.
  • Run commands such as i2cdetect -y 1 repeatedly. You will see inconsistent behavior with phantom devices appearing, devices disappearing, or no devices at all
@richteel
Copy link
Collaborator Author

Used bit bang with pigpio library. With current hardware, it supports up to 3 devices over 9 feet/3 meters. This is limited due to the line's RC time constant. May look into shorter cables and test with more devices to see if it will work. Also need to look into possible redesign of hardware although I am happy with the result.

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