Skip to content

Retune neopixel timings on SAMD51. They were too slow. #1096

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 1 commit into from
Aug 8, 2018

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Aug 8, 2018

Test the timings a reference PWM output because CPU clock isn't perfect.

import neopixel_write
import digitalio
import time
import board
import pulseio

pwm = pulseio.PWMOut(board.D10)
pwm.duty_cycle = 2 ** 15

pin = digitalio.DigitalInOut(board.D12)
pin.direction=digitalio.Direction.OUTPUT
pixel_off=bytearray([0,0,0,0])
pixel_on=bytearray([0,255,0,0])
while True:
    neopixel_write.neopixel_write(pin,pixel_off)
    time.sleep(1)
    neopixel_write.neopixel_write(pin,pixel_on)
    time.sleep(1)

Fixes #1083

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Great!

@dhalbert
Copy link
Collaborator

dhalbert commented Aug 8, 2018

Will wait for @jerryneedell to test, if he has time.

@jerryneedell
Copy link
Collaborator

@dhalbert Sorry, I may not be able to test it for a week or so.

@dhalbert dhalbert merged commit 2e80f37 into adafruit:3.x Aug 8, 2018
@jerryneedell
Copy link
Collaborator

jerryneedell commented Aug 19, 2018

I downloaded and tested https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/itsybitsy_m4_express/ commit 2e80f37
-- it works as before when conencted to 3V power and a 3V GPIO pin (D13) but it still fails is powered via VUSB and the 5V D5 pin?

can you verify that I used the correct build?
it shows up as

Adafruit CircuitPython 3.0.0-4-g2e80f37 on 2018-08-08; Adafruit ItsyBitsy M4 Express with samd51g19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants