APA102 investigation. Different libraries, shared clock pin, etc.

Status
Not open for further replies.

dimitre

Well-known member
Hello, I'm looking for some advices regarding APA102 LED Strip.

I've used a lot FastLED library but it now lacks support to Teensy 3.5 and I've researched some options.
One of them is this one https://github.com/pololu/apa102-arduino
which is very simple, and allows you to use only one pin as Clock for all output ports, saving pins.
in my project it would be OK because all strips are in sync.

But testing I've found it is a lot slower than FastLED. FastLED itself gets confused when sharing Clock pins.
It may be because I'm using pin 14 as Clock and it consider SPI. If I force a slower datarate, about 4 Mhz things start to work.

Do you have any recommendations of libraries, or techniques? I would love an APA102 only library with performance similar to FastLED.
Thank you

17333215_620142424838378_184875226578812928_n.jpg
 
In the library APA102.h transfer() function replace the digitalWrite() statements with digitalWriteFast(), and be sure in your code your data pin and clock pins are constants or defines. This will speed up the pin twiddling as much as possible; in fact it might make them so fast you might need to insert delays between the digitalWrite(clockPin, HIGH); and digitalWrite(clockPin, LOW); statements so the APA102s have enough time to see the clock.
 
Status
Not open for further replies.
Back
Top