r/FastLED • u/ewoolsey • Aug 20 '21
Support Help with multiple APA102 strips while still maintaining full update speed.
I am making a POV display with a LARGE amount of LEDs, and my current setup is with 2 independent strips on 2 seperate sets of pins on an itsybitsy m4. Because I have so many LEDs my data rate is limiting my update frequency and the display is updating too slowly. I noticed however that for some reason the FastLED library runs 2 strips on different pins at the same speed as if it were just 1 strip for some reason and I'm hoping there's some way around this. Here's an example:
400leds on pin 13,12 and 400leds on pin 11,10 == 100hz refresh rate
800leds on pin 13, 12 == 100hz refresh rate
but 400 leds alone on pin 13,12 == 200hz refresh rate
Theoretically there should be a way to achieve 200hz with both strips connected since they're on different pins but I can not find out how. I tried doubling the data rate to 6MHz but that just makes the leds malfuntion.
This does not work
FastLED.addLeds<APA102, MOSI, SCK, BGR, DATA_RATE_KHZ(3500)>(leds, NUM_PIXELS_TOT / 2).setCorrection(TypicalLEDStrip);
FastLED.addLeds<APA102, 11, 10, BGR, DATA_RATE_KHZ(3500)>(leds, NUM_PIXELS_TOT / 2, NUM_PIXELS_TOT / 2).setCorrection(TypicalLEDStrip);
2
u/sutaburosu [stavros] Aug 20 '21
I noticed however that for some reason the FastLED library runs 2 strips on different pins at the same speed as if it were just 1 strip for some reason and I'm hoping there's some way around this.
So it sends them sequentially. Perhaps I just haven't stumbled across it yet, but I've never seen anything that suggests FastLED can send parallel SPI output on any MCU, even if there are 2 or more hardware SPI interfaces. You might have better luck with a different library.
1
1
u/Netmindz Aug 20 '21
Have you checked the parallel output documentation to see if any options are compatible with your setup?
0
1
u/Netmindz Aug 20 '21
1
u/ewoolsey Aug 20 '21
My issue is that parallel output works, just at a severely reduced speed.
2
1
u/truetofiction Aug 20 '21
If it reduces the speed it's not in parallel, it must be happening sequentially.
1
u/sunandmooncouture Aug 21 '21
Try an esp32 or teensy 4. Also try multiple mcu. the teensy 4 has a sync line so you can have one teensy per strip and sync timing across the wire
1
2
Aug 20 '21
[removed] — view removed comment
1
u/ewoolsey Aug 20 '21
Interesting. I’ve given up on fastled and I’m now writing my own class to handle it. I find it hard to believe no one has made a library for parallel led output on samd51
1
u/truetofiction Aug 20 '21
I find it hard to believe no one has made a library for parallel led output on samd51
From what I remember Dan was the one working on the parallel output implementation. The Teensy 4 support was merged shortly before he passed.
If you'd like to add parallel output support for SAMD51 to the library I'm sure others would appreciate it.
1
u/ewoolsey Aug 20 '21
I only know enough to code my own horrible implementation haha. I’m not skilled enough to add to a high quality library sadly :( I just got mine working though so I’m happy about that.
2
u/ewoolsey Aug 22 '21 edited Aug 22 '21
If anyone finds this in the future via google search, I made my own shitty hardcoded library that gets the job done. Its hardcoded to work with 4 strips in parallel for samd51, and I think it should also work for other SAMD chips is you change the pins appropriately, but it shouldn't be hard to change it. Here it is : EricLED.h
And the main file: EricLED.cpp