Skip to content

Fast channel reads via caching last channel #33

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 3 commits into from
Jun 3, 2019
Merged

Fast channel reads via caching last channel #33

merged 3 commits into from
Jun 3, 2019

Conversation

caternuson
Copy link
Contributor

A different approach for #27 as suggested by @ladyada here:
#32 (comment)

@ladyada
Copy link
Member

ladyada commented Jun 1, 2019

question: why ever update the register pointer?

@caternuson
Copy link
Contributor Author

It is required for every write operation. For reads, it is only need if you want to read a different register.

There is only one conversion result register. So reading the result from a different channel requires doing a write to the config register to change the mux. That's why this fast read is pretty much limited to a single channel. Otherwise the I2C overhead to change the mux slows it way down.

@ladyada
Copy link
Member

ladyada commented Jun 3, 2019

okidoke!

@ladyada ladyada merged commit 6f0cfb2 into adafruit:master Jun 3, 2019
@caternuson
Copy link
Contributor Author

OK, this approach then, that's cool. But I think I might need to tweak this again a little. Sry. Realized this yesterday but was AFK. Repeated reads in SINGLE SHOT will still require writing to the config register to actually start the conversion - gotta set the OS bit. So just need to tweak the logic a little.

@ladyada
Copy link
Member

ladyada commented Jun 3, 2019

np thank you for the perseverence
!

@caternuson
Copy link
Contributor Author

Hmmm. Should I just make a second PR for the updates. Or is there a fancier way to revert this merge and then re-merge with the updates?

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 6, 2019
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.

2 participants