adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
MIT License
3.98k stars 1.17k forks source link

#2297 breaks status neopixel on SAMD51 boards #2357

Closed theacodes closed 4 years ago

theacodes commented 4 years ago

It seems something about #2297 broke the status neopixel, at least for Winterbloom Sol boards.

Firmware built from previous revisions works fine, and all firmwares built after the change are affected.

The pixel works in the bootloader, but once circuitpython starts it's off. Neither the supervisor nor user code (using neopixel_write or neopixel) are able to control the neopixel.

Surprisingly, I had one board where the status pixel almost worked - it just displayed the colors incorrectly (basically wouldn't display anything below ~127 on each color channel).

deshipu commented 4 years ago

The neopixel protocol is very timing sensitive, so the original code probably had to compensate for all those background tasks being called in the background...

theacodes commented 4 years ago

Slight update: @jepler was able to reproduce this on SAMD builds.

Also, here's a logic analyzer capture from the broken build when writing (0b01010101, 0b01010101, 0b01010101) to the pixel:

Annotation 2019-12-05 085749

Compared to a working build:

Annotation 2019-12-05 090427

dhalbert commented 4 years ago

Still works on SAMD21: Trinket and Metro M0

theacodes commented 4 years ago

Updating from the discord conversation.

@jepler has a much better analyzer than me. It seems the issue is that the timing is about ~10% faster:

bad (917khz): MSO1104Z_2019-12-05_11 15 02

good (800khz): MSO1104Z_2019-12-05_11 17 00

jerryneedell commented 4 years ago

just to clarify -- this issue is not limited to the "status" neopixel -- For example, on a grand central_m4_express, I cannot operate a neopixel ring on Pin A1

jepler commented 4 years ago

Closed via #2363