question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WS2812B on SPI1 behaves different than on SPI0

See original GitHub issue

Describe the bug

When trying to run the sample from the repo with using SPI1 (GPIO 20) instead of SPI0 (GPIO 10), the strip lights up as almost completely white. A hint of color can be seen (red becomes a very light pink) can be noticed, as well as changes when using the TheatreChase. But when using e.g. Black in ColorSwipe, the strip becomes white.

Because we need to use SPI0 for another device, we need to switch to SPI1. Alternatively, an implementation with PWM would possibly work.

Steps to reproduce Enable spi1 by adding

dtoverlay=spi1-1cs

to /boot/config.txt and reboot.

Then change

SpiConnectionSettings settings = new(0, 0)

to

SpiConnectionSettings settings = new(1, 0)

and run the code

Expected behavior

The strip color should be the same when using either SPI0 or SPI1.

Actual behavior

The color is almost completely white when using SPI1.

Versions used

  • dotnet --info on the machine being used to build: 5.0.401
  • dotnet --info on the machine where app is being run: 5.0.400
  • Version of System.Device.Gpio package: 1.5.0
  • Version of Iot.Device.Bindings package (not needed if bug is in System.Device.Gpio): 1.5.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
OJapescommented, Oct 8, 2021

“-3cs” just enables more chip select lines. For WS2812B none is needed, so I’d like to keep it as low as possible. Anyway I’ve tested that and it doesn’t make difference.

It also seems that the SPI itself is enabled correctly because the “Animation” is perceptible.

UART is disabled.

0reactions
msftbot[bot]commented, Sep 26, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can you control several (2 or 4) LedStrips of the type ...
I read somewhere that only SPI0 works with DMA, but not SPI1. Therefore, SPI0 does not behave in the same way as SPI1....
Read more >
RGB Status & WS2812B - Plugins
I have a WS2812B strip I'm attempting to control using Rgb Status. So far no luck. The pi user is in the gpio...
Read more >
Ws281x SPI connection device type - Hyperion-Project Forum
anyone interested in testing a direct SPI attached ws2812 driver ? Yes, you read that correctly - no pwm, no dongles, not microcontrollers....
Read more >
Troubleshooting WS2812b LED strip with toggle on/off button
I have a very rudimentary setup with an arduino nano, an LED strip, a pushbutton and a resistor. I was trying to use...
Read more >
Running Way More LED Strips On A Raspberry Pi With DMA
The SMI hardware allows the Pi to shift out data to 8 or 16 I/O pins in parallel using direct memory access (DMA),...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found