Electronic – SPI bus termination and pull-up resistors

pullupspitermination

My microcontroller (ATMEL series) needs to communicate to a slave device using SPI protocol. I am designing the hardware. The maximum SPI bus speed is 1 MHz. The distance between the master and slave is less than 50mm.

Q1) Do I need to add termination in series on the SPI bus to avoid reflection at this SPI speed (1MHz)? If so, how should I calculate its value and where should I put the termination resistor – near the master or near the slave?

Q2) I have seen other reference designs where sometimes people use pull-up resistors on all SPI signals, sometime only on a few signals (CS or MISO) and sometimes none. Do we need pull-up resistors on SPI signals (since the SPI port is push-pull configuration)? The only time pins will be floating is until the microcontroller get its power and can set pins as outputs. So should I need to use pull-up resistors or what will happen if I don't use any pull-up resistors in my design?

Best Answer

  1. At 1 MHz and 50 mm (2 inches) you don't need terminations. You have ordinary on-board digital signals, and not even very fast ones.
  2. You don't need pullups or pulldowns on SPI lines. When used, SPI lines are always explicitly driven both directions. However, it can be good to put a pulldown (or pullup) on the MISO line. That is because this line is only driven by a slave when it's slave select line is asserted. When the bus is not used, all slave select lines are usually unasserted, so MISO floats. The arbitrary data value is irrelevant since nothing is looking at its value unless a slave is selected, but intermediate voltages on this line can cause the receiver in the master to draw excessive current or possibly oscillate. I usually put a 100 kΩ pulldown on MISO for this reason. It keeps the line harmlessly low when not in use. You could just as well use a pullup, as long as all the slaves stay powered even when not in use.