Electronic – What are some design concerns for off board SPI communication

spi

Overview:

I am communicating among 3 custom pcb boards with dspic33's on them using SPI. I have a master and 2 slaves, but I am sending both the slaves the same data (and letting them choose what to pay attention to).

Hardware setup:

The two slaves have built in BLDC motor controllers and the Master is controlling these motor controllers over SPI. The wires are run about 3 feet from the master to each slave and the headers are typical .1" pitch through hole SAMTECH headers. Each motor controller has it's own 3.3 volt regulator that runs the dsPIC/LV electronics. I use one motor controller regulator(lets call him A) to also power the SPI master DSPIC. To the other motor controller(lets call him B), I just run the SPI lines and ground from the master. The SPI clk is running at 100KHz

Getting to the point (Finally):

With no motors running this all works fine, all data comes through as expected to both slaves. However, when I start up the motors, Bslave no longer gets the correct data. He is either picking up extra clocks or dropping them, I am supposing do to the extra noise. In any event his checksums start failing. Aslave works like a champ no matter what.

1) Would you expect that all these devices need to be ran off the same 3.3 volt source? If so, can you convince me by talking about the longer inductance loop and black magic such as that.

2) Do you have any kind of rule of thumb as to how fast I can expect to be able to run the SPI clk and have success with a hardware setup such as above?

Best Answer

I've run SPI (2MHz clock) about 5m from 1 box to another box and I didn't hesitate in designing the clock and data to be balanced output. The (custom) cable between the two also used twisted pair and screen on both data and clock .

I also sent isolated power to the remote box via dc-to-dc convertors. I didn't have enough time to get this one wrong so possibly my solution was an overkill but hey, it worked. My reasoning behind this decision is that I didn't want "current consumption" spikes going down the screens of the twisted pair. The screenes were not connected to ground at the PC sending end. Treat digital signals like precious analogue signals to get the best performance - always have your screen terminated at the receiving end and if you must (for whatever reason) terminate grudgingly (as well) at the send end.

It was for transmitting 128 channels of low speed analogue signals to a break out box from a PC. I suspect, that if I'd needed to I could operate this at 20MHz clock.