SPI line length

hello,

Is there limit for SPI wire length for connecting devices ?

Depending on your cable and transmission speed there WILL be a distance beyond which it will not work reliably. I have no idea if it's possible to calculate. Perhaps you should just try it and see what happens. For maximum distance you'll want to use minimum bit rate.

Do you have a particular length in mind?

Worst case it you either bit bang the SPI and run it really slow, or use line driver chips, that would get you a few km I would think.


Rob

LOL

No, you can't bit bang the SPI. The slowest it can possibly go is clock / 128.

It's a synchronous transfer. The Master and Slave have to be in close proximity. Like... on the same PCB.

Go with... 1 foot max distance and you'll be good.

Dude! Did you really mean to use km? Kilometers? Really?

No, you can't bit bang the SPI.

Why not? I've done so many times. Not using the SPI hardware of course, just pick 3 pins and wiggle the bits.

Dude! Did you really mean to use km? Kilometers? Really?

Well I haven't actually tried it :), but if you use RS-485 drivers and run fairly slow I don't see why not. RS-485 is rated for 1200m at 100kbps but would do longer at slower speeds I would think.

It's a synchronous transfer. The Master and Slave have to be in close proximity. Like... on the same PCB.

That's basically true and the way it's normally used, but you can think outside the square.

Of course if you really needed that line length SPI would not usually be the best choice. OTOH say you want a 7-segment display running from a few shift registers 300m away. If you use async you have to add a remote processor, with SPI you just need a shift register.

(note I use the term SPI to mean any clock/data style sync protocol which may or may not use real SPI hardware)


Rob