I'm using some ws2803 led driver chips daisy chained on reasonably long (for the spec) cables, using the spi bus for communication (data and clock). One of the cables in the chain needs to be slightly longer than the others and the leds connected to drivers after this cable perform erratically, especially when adjusting the brightness of lots of leds at once.
The funny thing is. If I touch this cable with my hand, the problem goes away! Sadly I'm unable to stay next to the installation holding the cable as a long term solution.. What could this problem be??
Someone suggested that as spi is such a high frequency signal and can be prone to reflections down the data line, my hand might actually be absorbing some of the signal to the point that the reflection is no longer significant, but his fix of a 50ohm resistor on the data line did not help, so I'm dubious.
I've tried different types of cable. Cat5, sheilded 2 core, twisted two core, and nothing has really helped.
SPI is really designed for short runs, 30cm perhaps. Its a full speed logic interface with no concessions to long-distance data transmission.
However that's not strictly your problem because the WS2803 isn't SPI. Its got schmidt-trigger inputs on its serial interface so will be a lot more robust to line noise than SPI.
However you still need to treat the cable as a transmission line for these lengths. Also you cannot expect to clock fast over long runs, try 500kHz or less.
[BTW if you don't have adequate decoupling for each WS2803, fix that problem first]
My paranoid suggestion for eliminating issues with long cable runs would be:
Send CKI and SI signals as twisted pairs, each paired with ground. (2 pairs of a CAT5 cable perhaps) Add 100 ohm resistors inline with each signal at both ends, and perhaps 100pF capacitor load between signal and ground at the receiving end. Use much lower clock frequencies and try increasing till failure (and backoff by factor of two or more).
This setup has anti-reflection resistors at both ends of the cable, protects the output pins from overcurrent when driving long (capacitive) lines, and bandwidth-limits the signal (reduce crosstalk and distortion), reduces RF-pickup (and emissions). Since the WS2803 inputs are schmidt-triggers they can cope with the slow rise and fall times.
Touching the cable increases the capacitance between the signal wires and ground, causing the signal edges to be less sharp and reflections to be reduced.
Another option is to go to a driver chip with a different interface and use a communications standard like RS485 that is inherently a bit more tolerant of interference to communicate among the daisy-chain of your LED assemblies. I doubt that these chips can handle SPI speeds reliably over long distances but serial should be OK and your LEDs can't blink as fast as the SPI bus and still do something useful, right?
Thanks all for your input. This forum is such an asset!
You'll be glad to know I fixed the problem with your help.
First off I tried the cap from data to ground. This fixed the issue at 60% of the problem points. The rest required a combination approach, with one set (There are 6 sets of these led chains running independently) needing a bypass cap on the supply to the first board, caps on the data line on two of the other boards, and a resistor to stop reflections on one of those boards as well!