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

test and adjust NeoPixel timings on multiple ports #6312

Merged
merged 1 commit into from
Apr 26, 2022

Conversation

dhalbert
Copy link
Collaborator

Reworked NeoPixel timings for a number of ports.
Fixes #5505.
Fixes #4102.

Tested with:

No work done on Spresense, i.MX, fomu, or broadcom ports.

The main issue was getting https://www.adafruit.com/product/5225 to work properly. It did not work on several ports previously. SAMD51 timings were also off enough that the first pixel was sometimes wrong.

The timings have been adjusted to:
about 300 ns high, 900 ns low, for a zero
about 700 ns high, 500 ns low, for a one
These vary per implementation, based on implementation constraints.

For reference, I added a datasheet summary to shared-bindings/neopixel_write/__init__.c.
.

Copy link
Member

@gamblor21 gamblor21 left a comment

Choose a reason for hiding this comment

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

Didn't have time to test on any h/w but looked at all the timings in the code. The PIO code I'm most familiar with and looks good to me. The other ports I have done less work with but everything looked right to me matching the timings you are suggesting. But I would defer to someone who has more experience with those ports. If no one is available I can take a closer look later this week if required.

@dhalbert
Copy link
Collaborator Author

feather_m0_supersized build failure is fixed in #6308 (just a size issue).

@dhalbert
Copy link
Collaborator Author

@PaintYourDragon probably of interest to you

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

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

I didn't do any testing, but in particular the RP2040 changes look like they do what they say.

@dhalbert dhalbert merged commit 63abd9a into adafruit:main Apr 26, 2022
@dhalbert dhalbert deleted the adjust-neopixel-timings branch April 26, 2022 20:57
@PaintYourDragon
Copy link

@dhalbert Indeed, of interest, thanks. Sounded like you already had this well under control, is why I didn’t chime in. If (when?) we ever have to confront this again in the future, I had some ideas on an ironclad once-and-for-all implementation (no more duty cycle debates). Notes are all in this CircuitPython code, so I’ll just attach the file here…
code.py.zip

@dhalbert dhalbert mentioned this pull request Apr 27, 2022
@dhalbert
Copy link
Collaborator Author

@PaintYourDragon Thanks! I collected some data like this in an ad hoc manner while working on the PR, but this is an excellent approach if/when we need to revisit this.

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.

Neopixel Library Issue Refine neopixel timing
4 participants