I'm trying to communicate my master board to slave, with SPI port. Our mechanical team says that it will be 3 meters long. Is it still tolerable? how about its noise? Thanks
-
1\$\begingroup\$ Need more details: is the environment noisy? Is your cable shielded? How fast is your SPI running? \$\endgroup\$– uint128_tCommented Feb 3, 2016 at 2:16
-
\$\begingroup\$ Let's add to the list - What are you driving the SPI with? What voltage levels are your SPI bus signals? What is the target device on the end of the interface? Have you considered what type of terminations that will be used? \$\endgroup\$– Michael KarasCommented Feb 3, 2016 at 5:47
-
\$\begingroup\$ Is the slave expected to respond or is it one-direction data from master to slave? \$\endgroup\$– Andy akaCommented Feb 3, 2016 at 8:35
1 Answer
I would expect problems if you try to use SPI directly- clock reflections as well as when you try to operate at higher speeds.
You can use SPI with a minor modification though- insert some LVDS drivers and receivers and drive balanced twisted-pair lines differentially in each direction. Make sure they're properly terminated (see the data sheets and app notes for the LVDS chips for the details). You'll need double the wires and a ground reference.
Maybe consider using an Ethernet cable that has 4 sets of twisted pairs (so you can devote a pair to ground and still have clock/MISO/MOSI pairs).
-
1\$\begingroup\$ +1. You could, alternatively devote the last pair to ground and power and then you might be able to remove the power supply and associated cost/complexity from the peripheral device... just a thought. \$\endgroup\$ Commented Feb 3, 2016 at 4:15
-
\$\begingroup\$ @DrFriedParts Worthy suggestion although if plugged into an ethernet port it might live up to your 'nym. ;-) \$\endgroup\$ Commented Feb 3, 2016 at 4:30
-
\$\begingroup\$ Agreed! ;-) Probably best not to terminate with RJ-nn connectors in this case. \$\endgroup\$ Commented Feb 3, 2016 at 4:39
-
1\$\begingroup\$ Though many devices require as chip select pin whether or not they are the only device, so the fourth pair would need to be used for that (perhaps single ended with GND on the other half of the pair). \$\endgroup\$ Commented Feb 3, 2016 at 4:47
-
\$\begingroup\$ @TomCarpenter Good point, or just do unidirectional communication with /CS. \$\endgroup\$ Commented Feb 3, 2016 at 5:58