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

improve SAMx5x NeoPixel timings #6280

Closed
wants to merge 2 commits into from

Conversation

dhalbert
Copy link
Collaborator

Fixes #4102.

This seems to prevent incorrect colors on the first NeoPixel in a string on SAMx5x processors. This is especially noticeable on 5v-level-shifted pins, such as D5 on ItsBitsy M4.

Timings were revamped by empirically changing the delay counts and observing the waveforms. The current timings in ns are below, and can vary by a couple of ns:

zero: 402 high / 834 low
one: 836 high / 402 low

This is close to the RP2040 timings, which uses PIO for precise timings
input zero: 416 high / 832 low
input one: 832 low / 416 high

Note that the far-end Neopixel, which regenerates the timings, is not like this. These far-end timings was observed when driving with an RP2040
output zero: 268 high / 978 low (varies slightly by a few ns)
output one: 698 high / 550 low (varies slightly)

@dhalbert
Copy link
Collaborator Author

Setting to draft while awaiting forum user tests, so it doesn't get merged before that testing.

@dhalbert dhalbert marked this pull request as draft April 13, 2022 20:09
kattni
kattni previously approved these changes Apr 13, 2022
Copy link

@kattni kattni left a comment

Choose a reason for hiding this comment

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

Tested with some odd strips on ItsyBitsy M4 on pin D5. One strip had the first pixel issue when lighting up red. The other two had no issues. Approving with the caveat that the weirder strips will still need to be tested and the code perhaps refined.

@dhalbert
Copy link
Collaborator Author

closed in favor of #6312

@dhalbert dhalbert closed this Apr 26, 2022
@dhalbert dhalbert deleted the samx5-neopixel-timings branch April 26, 2022 03:33
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.

Refine neopixel timing
2 participants