-
Notifications
You must be signed in to change notification settings - Fork 180
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
WS2812 driver does not work with XIAO SAMD21 #540
Comments
I checked on the Circuit Playground Express (same chip) and it works fine.
If it's not a wire, it's hard to say what's wrong. It might be a faulty crystal oscillator or any number of other things. The way to know for sure is to connect it to a logic analyzer and look at the signal. Something else you could try: testing the same setup but using the Arduino IDE and a library like FastLED. |
This was just something I've observed when working on a random project that runs on RP2040 now anyway. P.S. LED strip we can rule out from the equation, the problem first discovered with another strip (different size and brand), same result. |
I don't have a Xiao so unfortunately I can't debug this issue myself. But here are some other ideas to narrow down this problem:
|
Tried with another XIAO board and another pin -- same result. An observation: on XIAO-RP2040 all output pins work fine, except D10. In D10 case only one LED is lit up, too bright and slightly pulsing. This in contrast with SAMD21 there all leds are brightly lit up. Code of my experiments you can find in #575 pull request. |
I have been able to reproduce this issue using an Arduino Nano 33 IoT. I'll see what I can do. |
The regular port access is around 4 cycles, instead of the usual 2 cycles for a store instruction on Cortex-M0+. The IOBUS however is faster, I didn't measure exactly but I guess it's 2 cycles as expected. This fixes a bug in the WS2812 driver that only happens on samd21 chips: tinygo-org/drivers#540
Here is a fix: tinygo-org/tinygo#3751 |
This is an unrelated issue, as it's an entirely different chip. |
I did, it works now, thank you. |
Not a problem at all, just an observation I thought worth to share. |
Feel free to close this as fixed when you see fit, otherwise I do that after TinyGo v0.28 is released. |
The regular port access is around 4 cycles, instead of the usual 2 cycles for a store instruction on Cortex-M0+. The IOBUS however is faster, I didn't measure exactly but I guess it's 2 cycles as expected. This fixes a bug in the WS2812 driver that only happens on samd21 chips: tinygo-org/drivers#540
Fixed in TinyGo v0.28 |
The regular port access is around 4 cycles, instead of the usual 2 cycles for a store instruction on Cortex-M0+. The IOBUS however is faster, I didn't measure exactly but I guess it's 2 cycles as expected. This fixes a bug in the WS2812 driver that only happens on samd21 chips: tinygo-org/drivers#540
The regular port access is around 4 cycles, instead of the usual 2 cycles for a store instruction on Cortex-M0+. The IOBUS however is faster, I didn't measure exactly but I guess it's 2 cycles as expected. This fixes a bug in the WS2812 driver that only happens on samd21 chips: tinygo-org/drivers#540
I've tried to drive RGB Led with XIAO board (SAMD21, 48MHz chip) and it does not work.
When trying the example, all 10 LEDs are very bright, almost white. One can see a hint of green and red, changing though.
Same example on a RP2040 (125MHz) board just works (blinking green and red).
The text was updated successfully, but these errors were encountered: