Author Message
 nocturnal1
 Posted: Mar 10, 2008 - 05:24 PM
 Joined: Jan 21, 2008 Posts: 308 Location: USA
 What is the maximium reliable transmission length for 4 wire SPI? I've search the internet and all I could find was this document which gives a fairly rough range of about 100cm but the graph is kind of difficult to read(page 3)http://www.ece.stevens-tech.edu/~bmcnair/ESRT-S05/Class%2013-14.pdf I thought I would ask here beacause on paper and actual practice are usually different.

 glitch
 Posted: Mar 10, 2008 - 05:33 PM
 Joined: Jan 12, 2002 Posts: 7835 Location: Canada
 How far can I drive on 1L of gasoline? (I'll answer yours, if you answer mine) The fact is, we can't answer your question with the data givem because there are many factors that will determine your maximum distance. (speed, line impedance, load capacitance, voltage.... and so on)

 ka7ehk
 Posted: Mar 10, 2008 - 05:50 PM
 Joined: Nov 22, 2002 Posts: 13987 Location: Tangent, OR, USA
 One of the simple but overlooked issues is clock rate for LONG SPI connections. Suppose that you are reading data from the remote SPI device. There is delay for the clock edge reaching the remote device. In real transmission media, it is about 0.5' per nanosecond. Then, there is the delay between the clock edge and the data being placed onto the MISO line, then (probably) the same delay for the data to arrive back at the master. This delay total MUST be less than the delay between the clock and the sample (usually the opposite edge of the SPI clock). Thus, if you are using a 16MHz processor and running the SPI at half system clock, you have no more than 62.5ns to get the data back. If the slave has a 5ns delay between clock and data, then you have an absolute max of 57.5ns for link delay. At 0.5' per ns, that gives you a max distance of 28 feet. Granted, this is very long compared to most SPI distance estimates, but it places an upper bound on what one can do. You can increase this value by reducing the SPI clock frequency. Jim _________________Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA Fournier RF4d - My dream plane!

 bobgardner
 Posted: Mar 10, 2008 - 05:50 PM
 Joined: Sep 04, 2002 Posts: 23983 Location: Orlando Florida
 I'd say get a cable with the length you need, write a test program to send and read known data in a loop, start at the highest rate, see if it works. If so, done. If not, slow clk rate down and recompile. Guitar cable is 47pf per ft. You might use this to calc a lo pass filter at the freq of interest? I bet you can go 10ft at 100K, can only go 1ft at 4mhz. _________________Imagecraft compiler user

 UNiXWHoRe
 Posted: Mar 10, 2008 - 06:41 PM
 Joined: Nov 03, 2006 Posts: 1120
 If you absolutely MUST use SPI for long runs, add in some repeaters at regular interval...

 awit
 Posted: Mar 10, 2008 - 07:42 PM
 Joined: May 14, 2003 Posts: 174 Location: Opole, Poland
 In SPI all lines are unidirectional. This allow to using any symmetrical transmission (e.q. RS485) to increase distance of reliable transmission.

 Gluteal-Cleft
 Posted: Mar 10, 2008 - 08:29 PM
 Joined: Sep 11, 2007 Posts: 340 Location: USA
 ka7ehk wrote: One of the simple but overlooked issues is clock rate for LONG SPI connections. Yeah, what he said. I was going to mention that I have, on one occasion, used ridiculously long wires to program a Mega8. It was horrible, I won't even admit to how bad it was. But it worked, the key item being that it ran at a slow clock speed.

 peter_smith
 Posted: Mar 10, 2008 - 10:22 PM
 Joined: Sep 18, 2006 Posts: 65 Location: Debrecen, Hungary
 You will have to use it at low speed! It is really sure. Another thing that will be needed is to use properly shielded wires! If you bring out the SPI from the PCB you will have a lot more noise source.

 nocturnal1
 Posted: Mar 11, 2008 - 05:19 PM
 Joined: Jan 21, 2008 Posts: 308 Location: USA
 So, (1) Adjust SPI clock frequency according to connection length. (2) Possible lo pass filter (3) Possible repeater (4) Use properly shielded wires UNiXWHoRe, could you give some more details about the repeater you mentioned or a site where I might learn more.

 bobgardner
 Posted: Mar 12, 2008 - 05:26 PM
 Joined: Sep 04, 2002 Posts: 23983 Location: Orlando Florida
 How do you know you need it before you do the experiment? Did you say how far you have to go? Have a desired speed? _________________Imagecraft compiler user

 nocturnal1
 Posted: Mar 12, 2008 - 06:46 PM
 Joined: Jan 21, 2008 Posts: 308 Location: USA
 Your'e right bobgardner, I don't know that I will need one. I should and will experiment first I just haven't heard of a repeater before and I'am interested in knowing more in general.

 bobgardner
 Posted: Mar 12, 2008 - 08:42 PM
 Joined: Sep 04, 2002 Posts: 23983 Location: Orlando Florida
 Its a 'schmidt trigger'... it reads in a digital signal that might be noisy, and retransmits it nice and square. _________________Imagecraft compiler user

 nocturnal1
 Posted: Mar 12, 2008 - 08:54 PM
 Joined: Jan 21, 2008 Posts: 308 Location: USA
 Thank you bob.

 Kleinstein
 Posted: Mar 12, 2008 - 10:18 PM
 Joined: Sep 22, 2007 Posts: 980 Location: Germany
 With long lines and steep slopes, one has to use impedance matching at the ends of the lines. Without properly terminated lines there can be ringing, which is particulatly bad on the clk line. Once using terminated lines and resonable drivers there is not much need for repeaters in between, unless you really go over 100s of meters.

 squidgit
 Posted: Mar 14, 2008 - 05:59 AM
 Joined: Sep 14, 2003 Posts: 4228 Location: Queanbeyan, Australia
 In my experience you don't get a chance to have to deal with slew rates and the suchlike. Running SPI at distance (~1M) I've only ever run in to problems with noise on the clock line throwing your sync out. You need good shielding and LPFication before you even need care about waveform. Then of course sufficient LPFication and shielding kind of Ronnie's your wanted waveforms as well... Meh, async tx ftw! -S. _________________Blag: http://www.niasdigital.com/blag

 Display posts from previous:  All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 Jump to: Select a forum Forum index|--[AVR (8-bit) Technical Forums]|   |-- AVR forum|   |-- XMEGA forum|   |-- AVR Wireless forum|   |-- AVR GCC forum|   |-- AVR Studio 5 and Atmel Studio 6 forum|   |-- AVR studio 4 forum|   |-- AVRfreaks Academy forum|   |-- AVR Tutorials|--[AVR Software Framework]|   |-- AVR Software Framework|--[AVR32 (32-bit) Technical Forums]|   |-- AVR32 Linux Forum|   |-- AVR32 General (standalone)|   |-- AVR32 Software Tools|   |-- AVR32 Hardware|--[General Electronics Technical Forums]|   |-- General Electronics|   |-- Atmel Security Products|--[Non-technical forums]|   |-- AVRfreaks.net Housekeeping|--[Non-topical forums]|   |-- Off-topic forum|   |-- AVRfreaks Trading Post
All times are GMT + 1 Hour