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