Well, not really arms. I’ve just put up a new version of the library that provides preliminary support for the teensy 3.0 arm based platform. What does preliminary mean? Well:
- Chipsets that required the timer are not supported on arm, this means the *595, hl1606, and lpd6803 chipsets. I may revisit providing support for them, though some of these chipsets also involved some asm work to make things happy.
- The TM1809, TM1803, and UCS1903 chipsets are not yet supported. I will be working on adding support for those chipsets next.
- SPI support, at the moment, is using a compatibility library, so it is not quite as fast as it could be. Still, much faster than AVR based arduino systems, though!
I just want to say, if you haven’t checked out the Teensy 3.0 yet, you should! This chipset smokes, performance wise. You can read a bunch about the platform here. Why am I really excited about this platform for future led projects?
- Clock speeds up to 96Mhz
- Ability to use DMA to drive certain classes of SPI chips (aka more cpu time for what you want to do!)
- More ram – 16kb of ram vs. 2kb or 8kb on the avr based arduinos
- 32 bit math operations – no more burning extra clock cycles because you want numbers > 255
- floating point support
- and more…
I’m looking forward to making use of a variety of these features going forward, working to keep this library fast, high performance, and let you focus on thinking about what you want your lights to do, not how you’re going to get them to do it!

Hi! I have been following the fastspi library for a while and I commend you for all your hard work! I was excited to see the recent update to the library and noticed that you said you added preliminary support for the ws2811. I downloaded the new package and looked through the code, but did not see any reference towards the ws2811 in the code. Am I missing something? Also does the WS2811 only run when using the library with MCUs that are >20MHz, like the 96MHz teensy3.0 (faster spi capability due to faster clock)?
Thanks in advance!
The definition for WS2811 basically maps to TM1809. Also, the WS2811, like the TM1809 is only supported on the 16Mhz arduino – I don’t have support for other clock speeds or platforms yet. I still need to do the support for the teensy 3.0 – but haven’t had the time to do that.
I put together a sketch to demonstrate driving 2 ws2811 strips on 2 regular digital pins using a ChipKIT Uno32 (any pic32 should work). It could optimized further in assembly, but I haven’t the time at the moment to do so. I suspect the Uno32 could drive 4 and maybe as many as 8 strips in assembly assuming you use pins that are all controlled by one of the port registers. I don’t know if this would be easy to incorporate into FastSPI since the timings are for the 80mhz micro.
http://myroundpeg.blogspot.com/2012/12/driving-ws2811-base-led-strips-with.html
To add to this, I’ve derived a stripped-down special-purpose version of FastSPI, using concepts from Brian’s example to make WS2811 lights work with the ChipKit. The timing code in mine is correct, and scales with as many pins as FastSPI supports. You can find the code at: https://github.com/voidptr/evolight/tree/master/FastSPI_LED_Chipkit_Minimal. It should be extremely easy (with some minimal #defines) to bring the support into the main library.
Unfortunately, the link you supplied isn’t working. That said, I’m currently working on a rewrite of the library that, among other things, makes supporting more platforms much much easier and more chipsets much easier. I’ve got the ws2811 code chugging along at exactly 20 cycles per bit on a 16Mhz arduino as one of my test cases. The code will also strip out everything not being used making it far far more compact than the currently library is. And it supports mixing and matching chipsets, even (which is important, as it makes building a test harness much easier for me!)
awesome! I can’t wait to try this out, my teensy 3.0 is in the mail and should be here soon!
Do like! Do like a lot! I’ve got a T3 running some ws2801 strips at 750fps/32 leds. My only niggle I keep running into is I need to use spi for other peripherals and they aren’t playing nice. I will figure this out though!
I am using the newest FastSPI library with Teensy 2.0 and Arduino 1.0.1 and the example project wont compile….
/Users/VoltVision/Documents/Arduino/libraries/FastSPI_LED/FastSPI_LED.cpp: In member function ‘void CFastSPI_LED::show()’:
/Users/VoltVision/Documents/Arduino/libraries/FastSPI_LED/FastSPI_LED.cpp:539: error: ISO C++ forbids comparison between pointer and integer
/Users/VoltVision/Documents/Arduino/libraries/FastSPI_LED/FastSPI_LED.cpp:554: error: ISO C++ forbids comparison between pointer and integer
Sorry if this has been answered before. I did some searching and found an old patch, but that threw even more errors about misplaced “@”s. Thx!!!!
-VoltVisionFrenchy
Yeah – there’s some weird stuff about the teensy 2.0 that I haven’t had a chance to fully resolve. Once I get some time I want to finish up support for the teensy 2.0 and then turn my attention to the teensy 3.0.
Are there any news about Teensy 2.0? Thanks
Currently working on a major rewrite – teensy 2.0/3.0 support will be a part of that (as well a better path to supporting other platforms).
not sure if this is the place to ask this, though how can you make the LED strip refresh faster than 1ms? if in the void loop for the code you need to have a 1ms delay?
I think i’m missing something.
Is there any way to send a full strip of data to the WS2801 strips instead of one RGB led at a time?
What do you mean “refresh faster than 1ms”? The amount of time it takes to refresh the strip is a function of two things – the speed that the SPI bus is running at (and note, that the WS2801 doesn’t always allow you to run the SPI bus as fast as the host can run it), and how many LEDs are involved.
Running at 8Mbps means that it takes 1µs per byte or 2µs per rgb led. If you run at 4Mbps then it’s 2µs per byte or 6µs per rgb led. (I forget whether 8Mhz SPI runs at 8Mbps or 4Mbps max).
Which “void loop” are you referring to? Do you mean this one:
while(!(SPSR & (1<<SPIF)));
that's basically waiting for the register to reset indicating that we can hand another byte of data to the SPI subsystem to write out to the strip.
Things will get a lot more interesting on the teensy 3.0, which supports DMA with SPI, which means we'll be able to say "Write this block of bytes down the SPI bus" then go back to doing other things while that happens in the background.
Sorry, I could have been clearer. I uploaded the Arduino sketch example code to my Teensy3 and didn’t notice any significant differences between the Teensy3 and the Arduino Mega 2560.
So the void loop was
void loop() {
for(int j = 1 ; j < NUM_LEDS; j++ ) {
for(int i = 0 ; i < NUM_LEDS; i++ ) {
//memset(leds, 0, NUM_LEDS*3);
leds[i].r = line[i+(j*NUM_LEDS)];
leds[i].g = line[i+(j*NUM_LEDS)];
leds[i].b = line[i+(j*NUM_LEDS)];
}
FastSPI_LED.show();
delay(1);
}
And the delay(1); was what I was referring to as the refresh rate.
I guess I'm missing something fundamental in how the led strips are addressed.
Also are there faster strips than the WS2801 ?!
Sorry if this isn't the best place for these questions, not sure where else to post.
Ah! That’s just for the demo code – it’s to control the speed that the leds are updating at – you can just remove that delay(1) there.
The LPD8806 seem to have far higher data rates than i’ve been able to get off of the ws2801. I’ve gotten 1200fps update rates over 160 leds on the teensy 3.0 with the LPD8806′s
Also – you can control the data rate for SPI transfers by changing the value passed into the setDataRate call.
Just ordered some LBD8806′s!
Thanks for the tip!
As for the WS2801′s, regardless of the dataRate the leds are ‘frozen’ randomly either on/off if i take out that delay(1); either on Teensy3 or ArduinoMega.
I’ll wait for the LPD8806′s and see what happens.
Unless you can think of a reason for it.
Any progress with the TM1809 strips? Thanks for the work!
Currently working on a major rewrite – teensy 3.0 support for tm* style chipsets will be a part of that, as will full support for the teensy 2.0 platform (and a better path to supporting other platforms).
That’s great news! I just received a Teensy 3.0 Yesterday. For my first, I plan to operate a WS2811 strip and be able to read various color patterns from a microSD card and control all of this from an android phone using bluetooth (whew). I was hoping to use the FastSPI_LED library to simplify things… but in the short time I was playing with it last night, was unsuccessful in correctly lighting the light strip.
Thank you for all of your efforts on this. by all the references I’ve found I can see that the FastSPI_LED library has become very popular.
–Wozzy
You should be able to use my library for that sometime in the next month (work and travel permitting). I just got first light yesterday on a full re-write of the library that, among other things, is focused on making portability to new platforms much much easier to pull off.