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

i2c: use open drain for output rather than flipping between input and output. #214

Merged
merged 1 commit into from
Sep 5, 2016

Conversation

ourairquality
Copy link
Contributor

Using gpio_enable and flipping the configuration appears to be a major cause of poor performance in the i2c driver, so this changes to using the outputs as open-drain only.

@ourairquality ourairquality mentioned this pull request Sep 1, 2016
@Zaltora
Copy link
Contributor

Zaltora commented Sep 2, 2016

Great fix, the performance gain is significant. I did a test with DS3231 example with a delay of 1 us from sdk :
old i2c lib = > 90kHz ; 1787 us process time
fix i2c lib => 300 kHz ; 940 us process time (current fix #214)
fast i2c lib => 370 kHz ; 570 us process time ( the alternative lib #202 )

@projectgus
Copy link
Contributor

Thanks @ourairquality, this looks good to me! 👍

@sheinz sheinz merged commit c342763 into SuperHouse:master Sep 5, 2016
@sheinz
Copy link
Contributor

sheinz commented Sep 5, 2016

Thanks @ourairquality.

Has anyone tried GPIO 16 with i2c already?

@ourairquality
Copy link
Contributor Author

@sheinz It's not expected for work on GPIO 16 now as GPIO 16 has no open drain support (or at least it's not in the code yet).

@Zaltora
Copy link
Contributor

Zaltora commented Sep 5, 2016

One other inconvenient of GPIO 16, this pin is very slow to switch between state.

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.

4 participants