24
\$\begingroup\$

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?

\$\endgroup\$

1 Answer 1

38
\$\begingroup\$
  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.
\$\endgroup\$
1
  • 17
    \$\begingroup\$ One important reason to put a pullup on the CS/SS pins is to ensure that all slaves remain deselected when the master is in reset or starting up. In that case, its pins are usually hi-Z and thus floating, which could lead to multiple slaves being selected and driving the MISO bus (resulting in short-circuits). Maybe this would be a useful addition to this answer? \$\endgroup\$ Commented Aug 28, 2019 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.