Hello I'm having a bit of a problem attaching multiple strips of APA102 to

(Tim Chown) #1


I’m having a bit of a problem attaching multiple strips of APA102 to a teensy 3.1 I’m trying to attached 4 strips to the two sets of hardware SPI pins using this method:

FastLED.addLeds<APA102,7,13, BGR, DATA_RATE_MHZ(16)>(leds[0], NUM_LEDS_PER_STRIP);
FastLED.addLeds<APA102,7,14, BGR, DATA_RATE_MHZ(16)>(leds[1], NUM_LEDS_PER_STRIP);
FastLED.addLeds<APA102,11,13, BGR, DATA_RATE_MHZ(16)>(leds[2], NUM_LEDS_PER_STRIP);
FastLED.addLeds<APA102,11,14, BGR, DATA_RATE_MHZ(16)>(leds[3], NUM_LEDS_PER_STRIP);

When I do this the fps drops by half (I’m getting 168fps as opposed to 384fps when it’s running one long stips on one set of SPI pins). Do you know any reason why this might be happening?

I should say I’m trying to run about 600LEDs but they’re not actually connected yet as I’m waiting for some 144LED/m strips to arrive and trying to optimise the code in the mean time.



(Daniel Garcia) #2

Because they aren’t running in parallel. It’s still only writing one strip’s worth of data at a time. There is no parallel apa102 output yet.

ETA: also make sure you have the most recent version of FastLED - if you have an older version then some of those pin combinations will drop to bit banging.

(Tim Chown) #3

I think I’m up to date on FastLED, I’ve got version 3.1.0.

I realised it’s not a parallel output but as I’m splitting it into four strips of 144 instead of one of 576 it’s the same number of LEDs so I was expecting roughly the same fps?

(Daniel Garcia) #4

I’ll do some testing here - Also - there is some overhead in the before/after writing each strip’s worth of data out.

Finally - when you did the single strip - did you also do DATA_RATE_MHZ(16) in the addLeds line - or did you not put that in? If you didn’t put that in, that defaults to a data rate of 24Mhz (and I think DATA_RATE_MHZ(16) might drop back to 12 on the teensy? but don’t quote me on that)

(Tim Chown) #5

Yes running the single at 16MHZ. I’ve tried a few data rates at 12MHZ it’s still about half the speed at 8MHZ the gap a bit less and by the time you get to 4Mhz it seems quicker to be running it off the four separate strips. Don’t know if this is any help?

(Daniel Garcia) #6

The most recent master@head is 3.1.1 - grab the latest directly from github - http://fastled.io/code - there’ve been a lot of changes/fixes since 3.1 was released (including some around max frame rate).

I’m going to be spending the next few days traveling, so I probably won’t get to actually test hardware until some time early next week.

Out of curiosity - have you changed the CPU clock that you’re running the teensy 3.1 at?

Also - as an aside - why are you specifying a DATA_RATE_MHZ(16)? (I’ve run the APA102’s at DATA_RATE_MHZ(24) off of the teensy in a number of setups)

(Tim Chown) #7

Ok worked it out, it was me being an idiot. I’d be playing about with using software SPI on 8 pins and had left in the #define FASTLED_FORCE_SOFTWARE_SPI, whoops!

Now get 772fps which should be more than adequate for my project and there’s minimal difference between using four stips over one.

Thanks for your help and thanks for the awesome library :slight_smile: