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

Reduced I2C clock when talking to atMega on miniscope #340

Merged
merged 1 commit into from
Oct 21, 2024
Merged

Conversation

jonnew
Copy link
Member

@jonnew jonnew commented Oct 18, 2024

- Only set reduced (80 kHz) I2C clock when talking to the atMega, which
  has a bit-banged implementation
- For the rest of the chips, reset to to 200 kHz, which seems to provide
  max sampling on BNO while maintaining reliability
@jonnew jonnew added this to the 0.4.0 milestone Oct 18, 2024
@jonnew jonnew requested a review from aacuevas October 18, 2024 19:06
Copy link
Collaborator

@aacuevas aacuevas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only weird interaction that I can see is that, when changing a miniscope parameter (e.g.: led brightness), the threading model could: Set I2C SCLHigh value, poll a BNO value, then set the SCLLow and perform other operations. However, this should not be an issue, it would be akin to clock stretching, which already happens.

It should be documentes, nonetheless, that polledBNO does not guarantee pure periodicity and that it might be affected even further by this sporadic parameter changes.

Apart for this specific thing, which we just need to be aware of, I think this is a good overall solution. I assume it was tested in hardware as well.

@jonnew jonnew merged commit 1c05d6a into main Oct 21, 2024
7 checks passed
@jonnew jonnew deleted the issue-334 branch October 21, 2024 19:01
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.

Can miniscope i2c be switched to 400 kHz post configuration?
2 participants