Terminating and Routing MISO  - Page 1
Forum section: electronics / projects

author: PsychedelicBreakfast
author_rank: Contributor
timestamp: July 25, 2012, 02:17:51 pm
content: Hello all,I'm looking for some advice on how to terminate my SPI bus. The bus consists of 11 devices about half of which are external to the PCB which has the master (an AVR). The length of the ribbon cables is max. 6". My frequency of operation is just 2-4 MHz - and I know at those frequencies it's probably better to forget about termination altogether but with rising/falling times of 7 ns I'm facing some issues. The total length of the traces, including cable, is approximately 8-9".On the current revision of the board I don't have proper termination but rather series resistances (not meant for source termination) to slow down the rising times. This helps but only to an extent.From what I've studied it seems point to point transmission lines are the easiest to terminate via source termination. To 'convert' my SPI bus to mostly point to point I've added a couple of buffers which sit just before the off-board connectors. These buffers have SCK and MOSI as inputs. At the output I have source termination resistors and each output drives a single load. All well and good so far - I should add I haven't done this for devices which sit next to the master. Because they're very nearby (max 2" trace), I didn't feel the need to have a series terminator there. These devices are driven by a single buffer.My main issue starts with MISO. This line is a "multiple source single load" type. My question is, how do I terminate this line? The main PCB can connect upto 4 external boards each of which has 2 SPI devices. Do I put a source resistor for each device, join the traces, pass them through the ribbon cable and simply let that trace join the others wherever I want? Do I join the trace at the load only? What's the best way to route and terminate this type of line?[I've posted this question on AVRFreaks as well but also wanted to post here to get more responses. Hope that is ok!]

author: poorchava
author_rank: Super Contributor
timestamp: July 25, 2012, 04:09:36 pm
content: Come to think of it, I guess first thing I would try would be to place a resistor in series with slave MOSI near the slave to limit the slope. I think that resistor value depends on cable properties (capacitance/inductance) and is easiest to be found out by experiments.On the other hand I've once connected a board with controller to 10 sensors interfaced via 2 separate SPI interfaces with ~40-50cm long cables and didn't have any problem. IIRC the bitrate was 2Mbps.

author: jahonen
author_rank: Super Contributor
timestamp: July 25, 2012, 04:29:33 pm
content: Orthodox termination of a multipoint line would be such that there is a termination at each end of the line, like in old coaxial ethernet. Also, each device connecting to this trunk should have reasonably short stub.But, since the edges of the SPI data line won't actually matter, as long as you make decisions of the state of the line when all reflections (bouncing and ringing) have settled, i.e. use low enough bitrate, you could do with simpler schemes. Of course, if reflection amplitude gets too high, it might even do some damage so some effort should be made to minimize that.Also, if you are using a ribbon cable, remember to connect each other pin to ground, this makes it more resistant to crosstalk, which might be otherwise a problem (especially between clock and data lines).Regards,Janne