Does anyone have advice about choosing CLK/DATA pins for APA102 LEDs with a Particle

Does anyone have advice about choosing CLK/DATA pins for APA102 LEDs with a Particle Photon? I’ve seen some projects use A3 for the clock and A5 for the data (e.g. many of the evilgeniuslabs projects), and have also seen D4 used for the clock and D2 used for the data (e.g. SmartMatrix APA102 Shield for Photon.) It seems like both pairs are potentially hardware SPI pins.

When I measured with a scope on my board it looks like D4/D2 is about ~25% faster for a string of 144 LEDs than A3/A5. So it seems like for efficiency D4/D2 would be best, but perhaps there’s a reason to choose A3/A5. I don’t know how the library is driving the pins, but it seems like there must be some difference given the performance. Does one scheme end up loading the CPU less due to DMA being involved?

Any advice is appreciated. It’s not a big deal to change later, but it would be nice to understand why there’s a difference.

With D2/D4 you can take advantage of hardware SPI. SmartMatrix additionally uses DMA to drive SPI for even more efficiency.

Louis - is SmartMatrix completely different software? Or is FastLED also using DMA if one chooses those pins?

Your SmartMatrix APA shield looks nice!

SmartMatrix and FastLED are completely different software. I don’t believe FastLED is using DMA at all. You can use FastLED and SmartMatrix together, take a look at the examples in the SmartMatrix APA library.

Re: Shield, thanks! The shield would be useful for a FastLED-only project as well. I believe Jason Coon is using the shield to drive WS2812s, by popping off the 4-pin JST SM header and putting on a 3-pin.