Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

CAT5 cable wires for SPI

Status
Not open for further replies.

I14R10

Full Member level 3
Full Member level 3
Joined
May 31, 2015
Messages
185
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,750
Hi

I have some 30m of old CAT5 cable. I guess it has 6 wires - 3 twisted pairs, I'm not very familiar with network cables.
So I would like to take advantage of it. I need 6-8 wires for connecting two boards. SPI communication, power, ground, and maybe 2 wires as a reserve for future use. But wires in CAT5 cable are twisted pairs. What effect will that have on SPI communication? i can, of course, use only one wire from each pair if it causes problems, but I wanted to hear your opinion. Distances are 2-3 meters.
 

CAT5 usually has four twisted pairs and SPI can be at any speed so answering is difficult. I would say it isn't recommended at all but gut feeling is you might get away with it if the speed is low and over such short distance. Certainly twist each wire with ground and not with another signal. SPI is really intended for communication between circuits on a single board, not between different boards. A better, if a little more complex, solution is to convert the signals to differential ones and back again, that will let you use CAT5 over much greater distances and very reliably.

Brian.
 

CAT5 usually has four twisted pairs and SPI can be at any speed so answering is difficult. I would say it isn't recommended at all but gut feeling is you might get away with it if the speed is low and over such short distance. Certainly twist each wire with ground and not with another signal. SPI is really intended for communication between circuits on a single board, not between different boards. A better, if a little more complex, solution is to convert the signals to differential ones and back again, that will let you use CAT5 over much greater distances and very reliably.

Brian.
What I'm doing is I have raspberry pi which communicates via SPI with RFM98 LoRa module which works on 433 MHz. RPi and RFM98 can't be closer than these 2-3 meters. Would you then say it's better solution to have RPi and RFM98 very close and use 2-3 of high quality antenna cable?
 

That would be a far better solution. The only reason for keeping distance between the module and RPi is to prevent RF interference between them. If you can position the antenna away from the RPi it will have the same effect and save all the problems of moving SPI over long wires. It may also allow you to position the antenna where you get better range and you don't have to carry supply voltage to it.

Being honest, in real life I doubt they would interfere with each other even at 1 meter spacing but that is only my own opinion.

Brian.
 

That would be a far better solution. The only reason for keeping distance between the module and RPi is to prevent RF interference between them. If you can position the antenna away from the RPi it will have the same effect and save all the problems of moving SPI over long wires. It may also allow you to position the antenna where you get better range and you don't have to carry supply voltage to it.

Being honest, in real life I doubt they would interfere with each other even at 1 meter spacing but that is only my own opinion.

Brian.
Thanks, I'll do it that way.
And no, RPi and RFM98 didn't interfere even now when they are 10cm apart. It's only 1W of power, probably way less that's being emited with antenna it has right now.
 

Twisted pairs are used for differential signals (balanced) hence a good to a very good electromagnetic coupling between the wires. Lets have following scenario: one twisted pair, 1st wire is MISO and 2nd wire is MOSI. MISO is high and MOSI is switching from high to low. Due of good electromagnetic couple between those two wires MISO will "see" this transition. Now, depending on how strong the "attack" is MISO can detected a bit even when is not there.
You have following options:
1. Use twisted pairs but check before hand what combinations of wires will gave you the best result
2. Use it only at low speed and short distances: <100K and <2m (you must experiment and check).
3. Untwist the wires and use 4 wires from two pairs
4. Use a single wire from each twisted pair for each signal and remained wire used it as ground
5. Use a complete different cable:

For longer cables you take in account the EMI and EMC issues (ferrite core on cable, ESD protection, etc) especially when you want to go at higher speeds.

For more info: https://www.maximintegrated.com/en/design/technical-documents/tutorials/7/763.html

My suggestion will be to use something else like RS485 or CAN or CAN-FD to communicate between boards, then you can take full advantage of twisted pairs. With power over line second board can be remotely powered but increase design complexity.

All the best and good luck!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top