Pages: [1]   Go Down
Author Topic: Driving Multiple WS2801 LED Strands Quickly  (Read 966 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys. I have a project in which I have 1-5 different strands of WS2801 LEDs that I need to quickly control. Each strand can have a different number of LEDs, up to ~60 LEDs. I'm currently using Adafruit's WS2801 library.

Does anyone know if it's possible to share the clock line on multiple WS2801 strips? Particularly if the strips have different lengths. I figured it would make it faster only having to clock one pin instead of 5 different pins. Any other ideas to make this as efficient as possible?

I tried this with Adafruit's library but it didn't work as is. Also of note, I'm using a Bobuino with a ATmega1284p uC.

Logged

SF Bay Area
Online Online
Edison Member
*
Karma: 11
Posts: 1244
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It's probably not going to be faster, and not worth pursuing unless you absolutely must have them synchronized. Here's why. The WS2801 is a clocked shift register input, so it's much more relaxed than the WS2811 for bit timing. So you're hoping that you can just present the current bit for all of the strings, possibly as a port write instead of a pin write....that would make sense, if that was all you had to do. In order to prepare the bits for transmission, you still need to increment through each of the output bytes, do the bitshift, grab the bit you want, and store it into a variable that you'll write to the port later. It ends up being almost the same amount of cycles to do all that preprocessing, versus just doing a normal SPI write.

Here's one way to gain a lot of speed. Use the SPI hardware output peripheral, and set up a demux IC to aim the SPI clock output at one of the strips. Then you just drop a byte into the SPI register, let the hardware do the sending, aim the demux at another strip, and fire away. Probably 100% speedup over a software-only approach.
Logged

Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 517
Posts: 26282
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

ElectricDiode,
Didn't I describe doing just that for you in another thread already?
Instead of a demux, I suggested using an AND chip to gate the SCK line out to the strips.  Use an active High chip select ANDed with SCK - when the CS was High, the output follows SCK, and when Low the output is low.
Can output at up to 8 MHz speeds that way (max that SPI can do).
The WS2801 will support faster:
Maximum input clock frequency 25MHz

But 16 MHz Arduino hardware cannot, 8 MHz is fastest SPI output.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the responses guys. Great ideas, I'll be trying these out.


ElectricDiode,
Didn't I describe doing just that for you in another thread already?
Yes, indeed. It was in a private message. This thread here was created before I received your private message. Thanks for the follow up though.

I appreciate the help.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 517
Posts: 26282
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, too much going on. I lose track of what's where.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: