Number of SPI ports on Arduino Mega?

From the datasheet:
"The transmit the data over long distance by cascading, the WS2801 integrates push-pull output stage with strong driving capability which enables the data and clock can be transmitted up to 6 meters at 2MHz clock frequency."

In practice, at 2 MHz it's more like 10 meters before I start seeing pixels flicker wildly, and at 4 MHz it's about 5 meters before the signal becomes unreliable.

I'd love to know why this is and if there's a way around it. Maybe the signal starts getting copied incorrectly after a certain point? I had thought about trying to use a buffer that inverts the signal then inverts it back every 5M, not sure if that would help or not.

...or maybe buffering is not enough if there's a skew between the clock and data. If there was a way to synchronize clock and data...

As the clock and data follow the same path there wouldn't be any skew.

I'd love to know why this is

Line capacitance and resistance forms a filter that limits the frequency you can pass down the wire. Also reflected signals can cause problems.

I had thought about trying to use a buffer that inverts the signal then inverts it back every 5M

Exactly why I mentioned RS485 a few posts back, however inversion or no inversion make no difference, the drivers just have to be designed for the job.

You haven't addressed my point from my last post. How many LEDs are there? Do you really need 4MHz?


Rob

Graynomad:
Line capacitance and resistance forms a filter that limits the frequency you can pass down the wire. Also reflected signals can cause problems.

The datasheet calls for a 50 ohm resistor at the data input or output to "prevent the reflection". I tried putting a 47ohm resistor (closest E3 value resistor I had) at the start of the data line but that didn't seem to change anything...

Graynomad:
Exactly why I mentioned RS485 a few posts back, however inversion or no inversion make no difference, the drivers just have to be designed for the job.

Where would the RS485 driver go in this circuit? I don't know much about it other than that DMX512 uses the standard.
Are you suggesting I put a driver at the end of one strand and a receiver at the beginning of the next?
Would I need some sort of translator on either end of the driver and receiver to translate it into whatever RS485 talks in?

Graynomad:
You haven't addressed my point from my last post. How many LEDs are there? Do you really need 4MHz?

So far the most I've been able to control is 480. I at least have a need for about 960.
I would be nice to be able to control thousands, I don't know how feasible that is.
Yes, 4MHz would be preferable at some point, but right now 2MHz would probably do.

Where would the RS485 driver go in this circuit?

You need receivers on the WS2801 inputs and drivers on the outputs. That would be 2 chips per WS2801 if they are all 5+M apart.

Would I need some sort of translator on either end of the driver and receiver to translate it into whatever RS485 talks in?

Yep, like the LTC490 which has separate pins for the driver and receiver.

Is every LED 5M from it's neighbor? That would be one humungous array.

I would be nice to be able to control thousands, I don't know how feasible that is.

Quite feasible but you need to properly define the problem.


Rob

jfenwick:
Where would the RS485 driver go in this circuit? I don't know much about it other than that DMX512 uses the standard.
Are you suggesting I put a driver at the end of one strand and a receiver at the beginning of the next?

I had a play with RS485 here:

Two wires (plus power and Gnd) for async comms, although I think you can pump SPI down it ... maybe.

Anyway, with RS485 you could just have one sender and a lot of listeners. Depending on your application that could be enough.

Graynomad:
Is every LED 5M from it's neighbor? That would be one humungous array.

I see some miscommunication happening here...
I'm using strips similar to these: RGB LED Strip - 32 LED/m Addressable - 1m - COM-10312 - SparkFun Electronics
The strips are 5 meters long and contain 160 LEDs.
I'm guessing the problem still has to do with the distance the signal is traveling, so maybe RS485 would help.

Thanks for the link Nick, I am taking a look right now.