News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

How far can I drive an SPI connection

Started by JohnB, May 03, 2023, 02:27 PM

Previous topic - Next topic

JohnB

I want to drive an SPI connection to a matrix display over a distance of about 5 metres.
The connection will use cat6 cabling.

Will I need drivers or can I get away with TTL levels.
JohnB

tumbleweed

Electrically you could get away with it, but with that setup I'd be worried about signal integrity and noise issues.
With SPI, one glitch on the clock line and you're screwed.

I think I'd be looking at using differential drivers/receivers, something like LVDS or RS422. That would make it hard to do over a single CAT6 cable assuming you'd be using 8 signals + VDD + GND.


RGV250

Hi John,
As Tumbleweed says, I would be worried about the integrity.
Can you give us a bit more information, if it were me I would have the device driving the display very close or even mounted on it, you could probably power it from the same supply as the display. Send the data to the device driving it over RS232 or 422/485.

Bob

John Lawton

Some time ago I made a high speed SPI interface over LVDS using the DS90C401M and DS90C402M dual devices. The distance involved though was maybe 0.5m rather than 5m and I successfully used twisted flatstrip cabling.

With three pairs for Clock, Data and /CS (you don't say whether the display needs to talk back to the controller, assuming not), then you could just do it with a 4 pair cable.  The /CS line resets the receiver so I would have thought that a random glitch on the data or clock should only cause a very brief display issue that might not even be noticed.

JohnB

There is no requirement for a return path so I don't see any reason why I should not use a CAT6 cable with 3 pairs for Data Clock and CS and the other pair for +ve and the screen for -ve. I'll take a look at the DS90C401M
devices, thanks for the pointer.
JohnB

John Lawton

John, these are 5V devices which I required at the time, but I'm sure you will be able to find 3.3V devices if required.

RGV250

Interesting, article here says SPI is OK for 10mts and with LTC6820 up to 100mts on CAT5 cable.
https://www.analog.com/en/technical-articles/isolated-spi-communication-made-easy.html

Bob

tumbleweed

As I said, in a perfect world electrically it'll work at 10-15m. In the real world impedance mismatches and noise will have a big effect on the signals.
Unlike an async interface like a uart, SPI depends on the clock edges to transfer data, and that's the thing most likely to get mangled.

QuoteThe /CS line resets the receiver so I would have thought that a random glitch on the data or clock should only cause a very brief display issue that might not even be noticed.
The /CS will resync it on the next transfer, but you have no way of knowing what a clock glitch might tell the display to do on this transfer. Change modes? Position the cursor to never-never land?


TimB


From my experience with i2c I found that 1 mtr was hard at the speeds I was running at. I needed low value resistors around the 1k mark.

If you can slow the system down using bit banged SPI and place say a 10-20ms between each clock then it will help a lot.

If you have a scope you can try it out on the bench. See what the signals are like at the end of the cable.

tumbleweed

QuoteIf you can slow the system down using bit banged SPI...
Slowing the clock rate is only one small part of the problem.

The real issue is the edge transition speeds, which for most pics is on the order of 5ns or so.
That's a pretty fast signal that you have to try and get down a cable if you want the other end to look anything like the original.

trastikata

Can you add some small receiving circuitry to the display matrix?

JohnB

I will have to add some circuitry at the matrix end.
Currently I am going to try the FIN1001/1002 LVDS driver/receiver combo.
I'll give it a try on the bench before committing to PCB.
The data is not hugely critical as its only a repeater display, the main info being presented on an HMI screen with the MPU.
JohnB

trastikata

Quote from: JohnB on May 04, 2023, 05:50 PMI will have to add some circuitry at the matrix end.

If it is a single prototype project, you can easily get 2-4 pcs LTC4332 (2MHz SCK over 10m CAT5 SPI extender) from AD as samples, however for a mass production, it's on the pricey end.

JonW

I did a really big led matrix display for our rugby club.  Did a remote control and a laptop live update to scroll text but used RF.  Costs a few pounds and range was close to 2km (bit overkill)
Build 8x8 led panels at 6 inch and they are linked by serial to make a much larger array.  Each panel has a font table so you just send panel x display x.  Pretty fast scrolling. 
Display was 1m x 4m so fairly big.