Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

SPI Maximum Distance for 16 Devices

Status
Not open for further replies.

lynch

Newbie level 6
Joined
Jul 3, 2007
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,371
spi distance

Hi
Im designing 4 cirucit boards, one is a processor module (PIC33F device) the other 3 are for sensor measurments, each has a simple A2D with (SPI) interface.

The circuit boards will be connected directly with a plug and socket arrangement (no wires).

What is the maximum distance you can use SPI over? (as i may design more boards in the future although the max distance will be less than 70cm).

Should i use some kind of SPI driver chip to help buffer the SPI from the processor?

Is SPI the worng way to go as i have been told I2C is most often used over long distances?

Thanks in advance for any advice
 

z01z

Junior Member level 2
Joined
Oct 10, 2004
Messages
24
Helped
7
Reputation
14
Reaction score
0
Trophy points
1,281
Activity points
149
spi maximum distance

The distance will depend on the bus speed. 70cm is OK, question is, how fast do you want to go?
I've connected an SPI accelerometer with a ~1/2m cable, I was able to use 1.5MHz clock speed.
 

    lynch

    points: 2
    Helpful Answer Positive Rating

vijaya_narayana

Full Member level 3
Joined
Jun 12, 2007
Messages
172
Helped
11
Reputation
22
Reaction score
1
Trophy points
1,298
Location
India
Activity points
2,158
spi distances

hey try to study the SPI specification i think there u will get all the details
 

PaulHolland

Advanced Member level 2
Joined
Jan 15, 2003
Messages
664
Helped
95
Reputation
190
Reaction score
34
Trophy points
1,308
Location
Holland
Activity points
4,841
spi long distance

Hi, Wirelength and speed and number of devices connected is what matters. So if you have 100 devices connected your speed will be lower but if you only have a few devices connected you can go 1 meter. Unless your enviroment has lots of noise !/
 

    lynch

    points: 2
    Helpful Answer Positive Rating

lynch

Newbie level 6
Joined
Jul 3, 2007
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,371
spi bus distance

Guys,
I have up to 16 devices and our software engineers have specified a clock speed of 2MHz although this will most likely change during the development phase.

My environment is potentially very noisy (industrial) which means i must also isolate each SPI interface with appropriate opto's or equivelent devices i can find.

Anyone used any decent high speed, low If optos for isolating SPI?
 

PaulHolland

Advanced Member level 2
Joined
Jan 15, 2003
Messages
664
Helped
95
Reputation
190
Reaction score
34
Trophy points
1,308
Location
Holland
Activity points
4,841
spi interface distance

DO NOT SELECT SPI !!!.. Go For CAN Bus !. If you select SPI you will regret later you ever did !. Completely wrong choice for your application/enviroment
 

lynch

Newbie level 6
Joined
Jul 3, 2007
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,371
distance spi

Paul,
I would certainly like to use CAN bus but only one of the modules im designing has a processer with CAN the remaining modules just have SPI IC's thus no processor. Which meant SPI was the easy way to go forward.

I cannot use a processor on the remaining modules as the cost exceeds my budget.

Are there any usefull SPI to CAN interface IC's i can use without incurring the cost of a procesor/software etc?

Or can you suggest a different approach.

Cheers
Chris
 

PaulHolland

Advanced Member level 2
Joined
Jan 15, 2003
Messages
664
Helped
95
Reputation
190
Reaction score
34
Trophy points
1,308
Location
Holland
Activity points
4,841
isolating spi

Design a current loop for SPI yourself using Transistors etc... something like 10 - 20mA for high and 4mA for low... but do not use SPI just as is since it will give many problems. other options are LIN bus very low-cost and I believe Microchip makes a CAN chip with SPI interface :). Designing a low cost product is nice but if the cost is making quality or reliability bad your loosing only and have a low-cost non working product :)
 

    lynch

    points: 2
    Helpful Answer Positive Rating

lynch

Newbie level 6
Joined
Jul 3, 2007
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,371
spi max distance

Paul ill look into this straight away, i have used some mA transmitters from TI before ill have a look at these and see what freq i can work with.

Ill also check out the CAN SPi devices
Thanks fo the advice
Chris
 

z01z

Junior Member level 2
Joined
Oct 10, 2004
Messages
24
Helped
7
Reputation
14
Reaction score
0
Trophy points
1,281
Activity points
149
long distance spi

I agree with the other posts, do not use SPI in a noisy enviroment, use a differential bus like CAN or rs-422/485.
The microchip SPI CAN controller is the MCP2515, the CAN transceiver is the MCP2551.
 

    lynch

    points: 2
    Helpful Answer Positive Rating

kender

Advanced Member level 4
Joined
Jun 19, 2005
Messages
1,422
Helped
138
Reputation
276
Reaction score
38
Trophy points
1,328
Location
Stanford, SF Bay Peninsula, California, Earth, Sol
Activity points
9,968
can spi

SPI and I2C can be extended beyond the spec. For example, have a look at Philips AN255-02, which describes the use of their PCA9511...PCA9518 'rugged I2C' transceivers.

As a side note, I wouls choose the I2C over SPI, because it may let you "daisy-chain" the sensor nodes in the field. SPI would require individual chip-select lines.
 

    lynch

    points: 2
    Helpful Answer Positive Rating

fajarelektro

Member level 1
Joined
Oct 26, 2007
Messages
36
Helped
4
Reputation
8
Reaction score
3
Trophy points
1,288
Activity points
1,493
Re: spi distances

vijaya_narayana said:
hey try to study the SPI specification i think there u will get all the details
If there is a specification
 

GrandAlf

Advanced Member level 2
Joined
Mar 9, 2002
Messages
520
Helped
47
Reputation
92
Reaction score
6
Trophy points
1,298
Location
UK
Activity points
4,730
SPI distance

Other than using differential, I2C would be better at a distance, you can even get extender chips. If you wanted high speed, you would need MCUs with hardware I2C rather than bit banging.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top