Just wanted to do a small report on APA102 usage with the Teensy 3.1 and FastLED.
The setup I tested is 4 meters of 144 led/m so 576 leds in total. With 288 leds I was successful both with software SPI (on pins 2 and 3) and hardware SPI.
At 4 meters it would flicker using software SPI so I switched to hardware SPI which was worse. Lowering the rate to 8mhz (from 24mhz) solved the issue.
I now need to figure out how to send that much data using Max/MSP and the serial port… Seems like the Serial object in Max is pretty slow…
I noticed that different wiring setups can allow for different settings in the data rate too.
I’m commenting cause I’m interested in seeing what other people have to say- I’m planning on starting a hardware SPI based apa102 installation soon
also are you using 3.3v signals or something to step it up like 74HCT245?
pps did you try a bunch of different data rates, or did you drop straight to 8mhz from 24?
I was using 5v with the 74HCT245.
Jon Burroughs, when you say different wiring do you have more details ?
@Ryan_Clough I think I tried 12mhz which worked but went lower as I didn’t need it to be that fast anyway.
In Puredata, which is similar to MAX, people had issues with inefficient use of USB bandwidth when patches sent data one byte, or one small MIDI message at a time. Only Mac OS-X has a smart USB driver that combines many small writes into larger USB packets. Windows and Linux happily send each write given to the driver in its own USB packet, which incurs a lot of overhead. Windows also has some limits on the number of USB transactions per 1ms frame, which can really hurt performance if you use tiny writes. The key to good performance was to compose a big message and write it to the virtual serial port in a single operation. Maybe MAX does things better, but this was absolutely an issue with sending bytes from Puredata.
I’m using Max on a Mac. I usually send a frame at a time to the serial object as a big list of bytes. The Serial object in Max is limited to 1023 chunks and I have to group my data before sending (when controlling a lot of leds)
Someone sent me an object called AsyncSerial a couple months ago that should be faster although I haven’t tried it yet. The nice thing is that it can read a jitter matrix directly. Will post more info if it works out well…
@Nathanael_Lecaude can you forward me some additional information about AsyncSerial?
This would be interested for my next project.
@Jurgen_Skrotzky Here’s AsyncSerial:
http://michaelkrzyzaniak.com/Max/AsyncSerial/Xcode/Documentation/index.html#
I’ll try to find the version I was given which reads a matrix directly (I also want to ask the author if it’s ok to share)