rpi-ws281x / rpi-ws281x-python

Python library wrapping for the rpi-ws281x library
BSD 2-Clause "Simplified" License
319 stars 102 forks source link

Weird SPI Behaviour on RPi 3b #68

Closed joernschellhaas closed 1 year ago

joernschellhaas commented 3 years ago

I'm trying to control a single WS2812b LED with SPI on my RPi 3b.

While I'm generally able to address the LED, the colors are off and I've noticed some weird gaps in the output signal.

Signal with color set to all zeros: bmp_20_005

Output signal with color set to all 0xFFs: bmp_20_015-annotated So there's always a gap in bit#1 of every color (arrows). The output is totally reproducible. This is probably where the SPI output gets out of sync with the LED.

I am considering masking the affected bits since they are the second least significant ones anyway. But that would be a bit too much of a hack and I'm also interested in knowing the reason.

Note: I did not set the core frequency to a fixed value, but initialized the strip to a frequency of 1.2 MHz. I read somewhere that this works because it is within the timing spec of the LED. I might try to set the core freq to a fixed value.

Anyone else noticed a similar issue?

Gadgetoid commented 1 year ago

Issues with the underlying rpi_ws281x (https://github.com/jgarff/rpi_ws281x/) are outside the scope of this wrapper library and cannot be fixed here.

Possibly related to https://github.com/jgarff/rpi_ws281x/issues/499