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.

SPI Maximum distance

Status
Not open for further replies.

TXRX

Full Member level 2
Joined
Mar 7, 2012
Messages
143
Helped
2
Reputation
4
Reaction score
5
Trophy points
1,298
Activity points
2,252
Hi,

See attached, I have a SPI communucatin between Master to Slave only in ONE DIRECTION, the SPI clock is 1MHz and there is MOSI line, What is the maximum distance that it can reach ?

Thanks,

Doron
 

Attachments

  • SPI Maximum Distance.jpg
    SPI Maximum Distance.jpg
    49.4 KB · Views: 204

Since you are only going from master to slave, you have a little more latitude. But it still depends on your cable, drivers, etc. How far do you WANT to go? Even though you don't have to worry about the problems associated with reading from the slave, you still have to be concerned about signal degradation; i.e., your nice, square clock could be a mushy mess by the time it gets to the slave end of your cable.
 

Hi,

You need at least two other wires:
* GND
* CS....even if you have one device, and maybe you think it can be enabled all the time....you need it to synchronize the datastream.

How long:
* depends on many parameters.
* cable
* driver circuit
* receiver circuit
* frequency
* signal levels
Impossibe that anyone here can give you a reliable distance value.

If you want it for a very long distance then you may use RS422/RS485 differential signaling. For sure with appropriate cables and proper termination

Klaus
 

GND is not part of the SPI requirement. And SS MAY be required, but some slaves don't require it, although you'll probably avoid problems if you use it.
 

Hi,

Good luck by transmitting single ended SPI signals without GND as reference....

Klaus
 

Well instead you could convert the single ended SPI to LVDS and then use a twisted pair cable to send the SCLK, MOSI, and SS_N to the slave easily over 20ft. TI/National has some application notes about LVDS and some of the testing that was done looks to suggest that LVDS can be reliable at 100Mpbs over 20m cables, so your 1Mbps SPI would probably work even over 40m of cable.
 
  • Like
Reactions: ferdem

    ferdem

    Points: 2
    Helpful Answer Positive Rating
The original Motorola SPI specification includes a physical layer of single ended TTL/CMOS signals presuming a common ground. The four logical line bus also includes the SS (slave select) signal, which is also used as frame sync in single slave systems.

If you go beyond the original physical layer and use terminated transmission lines or preferably differential signalling like RS422, you can achieve several 100m at 1 MHz.
 

Hi,

Good luck by transmitting single ended SPI signals without GND as reference....

Klaus

There is GND and we work without SS.

Thanks
 

Hi,

we work without SS.
I wonder how you ensure that bytes, words or frames are received correctely....without a sync signal.

Klaus
 

Hi,


I wonder how you ensure that bytes, words or frames are received correctely....without a sync signal.

Klaus

The MOSI is sync to the clock, it works.
 

Hi,

for sure, but this is only the bit_sync,
But I´m talking about byte_sync, word_sync or frame_sync... whatever data you transfer. Without this sync an erroneous pulse (ESD, EMC) in the SCK line will cause invalid data forever.


Klaus
 

Hi,

for sure, but this is only the bit_sync,
But I´m talking about byte_sync, word_sync or frame_sync... whatever data you transfer. Without this sync an erroneous pulse (ESD, EMC) in the SCK line will cause invalid data forever.


Klaus

So how can i improve the immunity to an erroneous pulse ?
 

Hi,
So how can i improve the immunity to an erroneous pulse ?
Answer already given: use differential signalling and appropriate cables with proper termination.
But I´d not rely on that.
As you don´t have a signal back...you probably won´t recognize that you receive the data with bit displacement.

Maybe you could use UART. In this case it is more reliable, because it contains START and STOP signals to indicate the borders of a byte.
Still I recommend to use differential signaling. Additional UART benefit: you need less signal lines than with SPI.

Klaus
 

Hi,

Answer already given: use differential signalling and appropriate cables with proper termination.
But I´d not rely on that.
As you don´t have a signal back...you probably won´t recognize that you receive the data with bit displacement.

Maybe you could use UART. In this case it is more reliable, because it contains START and STOP signals to indicate the borders of a byte.
Still I recommend to use differential signaling. Additional UART benefit: you need less signal lines than with SPI.

Klaus

If i add SS which also mark the byte, Is it OK?
 

Hi,

Answer already given in post#3.

Note: CS = SS

Klaus
 

do u want to connect master and slave on board or using cables.?
on PCB you can simulate (general sim) microstrip/stripline to see the signal quality and decide on distance. that should give preliminary idea. consider all effects signal quality/GND bounce/Timing etc. MISO and MOSI capture times (tsu,thd) are different w.r.t Clk.
 

Unfortunately it's never been mentioned what the SPI slave is. You can omit SS as frame sync signal if and only if the slave supports alternative synchronization methods. This can be e.g. an unique data bit pattern or a timeout.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top