0
\$\begingroup\$

I am using Arduino(does not matter) and 8 x 12 bit-ADCs to read some values. I created a prototype which consists of a Shift Register(SR) and all outputs of SR are connected to individual ADC's chip-select pin. During boot, I set all output of SR as HIGH.

I select the ADC by pulling the specific output of the SR as LOW and then talk to the ADC. As soon as my communication is finished, I again set all output of SR as HIGH. This is all working.

During some testing, I found that if all SPI (ADCs) are pulled HIGH (none should be talking) and if I read MISO, I was getting some random data. I realized that MISO was floating and added a 100K pull-down (weak pulldown!) which sorted this out. After this, if I listened the MISO while all ADCs were HIGH, all I get is 0s (Yey!).

My question is that does it make sense to pull down MOSI and CLOCK as well? Will it create any problem?

\$\endgroup\$

2 Answers 2

4
\$\begingroup\$

You shouldn't need to pull down the MOSI or Clk lines.

Master Out Slave In is an output from your controller, as is the Clk line. Unless you do something that turns those pins to inputs, they should be just fine without either pull-down or pull-up resistors.

On the other hand, Master In Slave Out is an input to the controller. When none of your ADC chips are selected, that line does float. It needs the resistor that you added.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks! But would it hurt if I add 100K pull down to MOSI and CLK? \$\endgroup\$ Commented Apr 9, 2015 at 4:11
  • 1
    \$\begingroup\$ Generally, you know the state of MOSI and CLK at any particular time. But if you feel that they could float at some point, you could add the pull downs. It won't hurt at all. I always add 10k pull ups to the chip select lines because my CPU outputs floats for a while before it gets its act together! I don't want the peripherals thinking someone is talking to them... \$\endgroup\$
    – carveone
    Commented Apr 13, 2015 at 10:29
1
\$\begingroup\$

All CMOS inputs without built-in pull-ups or pull-downs must be driven to a valid logic level. So your question isn't related to SPI or even your application: it is basic circuit design aspect of working with CMOS digital inputs.

For each CMOS digital ("logic") input you must be able to show a circuit path that leads either to positive supply or GND, at all times, in all system configurations. Pull-up/pull-down resistors are just one possible way of providing such circuit path. Another would be weak MOS drivers - typically only available if you're laying out a chip design, but sometimes MCUs and other chips have those built-in, in such a way that the driver activates immediately on power-up, fulfilling the design requirement.

\$\endgroup\$

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.