---
+ Post New Thread
Results 1 to 13 of 13
  1. #1
    Newbie level 6
    Points: 1,031, Level: 7

    Join Date
    Jul 2007
    Posts
    11
    Helped
    0 / 0
    Points
    1,031
    Level
    7

    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

  2. #2
    Junior Member level 2
    Points: 1,784, Level: 9

    Join Date
    Oct 2004
    Posts
    24
    Helped
    7 / 7
    Points
    1,784
    Level
    9

    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.


    1 members found this post helpful.

    •   Alt19th September 2007, 14:14

      advertising

        
       

  3. #3
    Full Member level 3
    Points: 2,195, Level: 10

    Join Date
    Jun 2007
    Location
    India
    Posts
    156
    Helped
    10 / 10
    Points
    2,195
    Level
    10

    spi distances

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



  4. #4
    Advanced Member level 2
    Points: 6,537, Level: 19
    PaulHolland's Avatar
    Join Date
    Jan 2003
    Location
    Holland
    Posts
    664
    Helped
    94 / 94
    Points
    6,537
    Level
    19

    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 !/


    1 members found this post helpful.

  5. #5
    Newbie level 6
    Points: 1,031, Level: 7

    Join Date
    Jul 2007
    Posts
    11
    Helped
    0 / 0
    Points
    1,031
    Level
    7

    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?



    •   Alt20th September 2007, 08:01

      advertising

        
       

  6. #6
    Advanced Member level 2
    Points: 6,537, Level: 19
    PaulHolland's Avatar
    Join Date
    Jan 2003
    Location
    Holland
    Posts
    664
    Helped
    94 / 94
    Points
    6,537
    Level
    19

    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



    •   Alt20th September 2007, 15:22

      advertising

        
       

  7. #7
    Newbie level 6
    Points: 1,031, Level: 7

    Join Date
    Jul 2007
    Posts
    11
    Helped
    0 / 0
    Points
    1,031
    Level
    7

    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



  8. #8
    Advanced Member level 2
    Points: 6,537, Level: 19
    PaulHolland's Avatar
    Join Date
    Jan 2003
    Location
    Holland
    Posts
    664
    Helped
    94 / 94
    Points
    6,537
    Level
    19

    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


    1 members found this post helpful.

  9. #9
    Newbie level 6
    Points: 1,031, Level: 7

    Join Date
    Jul 2007
    Posts
    11
    Helped
    0 / 0
    Points
    1,031
    Level
    7

    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



  10. #10
    Junior Member level 2
    Points: 1,784, Level: 9

    Join Date
    Oct 2004
    Posts
    24
    Helped
    7 / 7
    Points
    1,784
    Level
    9

    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.


    1 members found this post helpful.

  11. #11
    Advanced Member level 4
    Points: 14,471, Level: 29

    Join Date
    Jun 2005
    Location
    Stanford, SF Bay Peninsula, California, Earth, Solar System, Milky Way
    Posts
    1,409
    Helped
    136 / 136
    Points
    14,471
    Level
    29

    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.


    1 members found this post helpful.

  12. #12
    Member level 1
    Points: 1,186, Level: 7
    fajarelektro's Avatar
    Join Date
    Oct 2007
    Posts
    36
    Helped
    4 / 4
    Points
    1,186
    Level
    7

    Re: spi distances

    Quote Originally Posted by vijaya_narayana
    hey try to study the SPI specification i think there u will get all the details
    If there is a specification


    1 members found this post helpful.

  13. #13
    Advanced Member level 2
    Points: 5,231, Level: 17

    Join Date
    Mar 2002
    Location
    UK
    Posts
    507
    Helped
    44 / 44
    Points
    5,231
    Level
    17

    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.



+ Post New Thread
Please login