3
\$\begingroup\$

From another stackexchange question it should be possible to have the SPI device select pin always asserted given that the SPI bus only has one slave.

I have other interesting features multiplexed to my SPI device select master, so I would like to get rid of the connection altogether and connect the SPI device select slave to a logic 0V via a pull-down resistor.

Is this feasible?

\$\endgroup\$
5
\$\begingroup\$

Although forcing the clock select should work in theory, you could have a problem with synchronization in practice.

SPI does not have framing bits. Instead, the slave knows that that a transaction always starts at the first clock transition after it is selected.

In theory, if you tie the select line low, then the salve should be ready and waiting and the 1st bit you send will be the 1st bit it receives. As long as you guys stay in sync, everything should be hunky dory.

Unfortunately it might not always work. During power up, say, there can be times when the clock line is in an intermediate state and the slave could potentially see a clock pulse when the master didn't send one. If this happens, the master and the slave will forever be out of sync.

You might be able to mitigate the risk of this start-up problem by using a clock polarity with a base of 0 and by using a pull-down resistor large enough to ensure that the clock stays low during power up by not so large that you can not actively drive it high.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ This is the best answer. I've personally seen a honeywell humidity sensor not work when I tied cs to ground, took me hours to figure out why and this was it--it was out of sync. Soon as I toggled cs it worked. \$\endgroup\$ – Paul L Dec 26 '15 at 19:54
2
\$\begingroup\$

Whether the SPI chip select is needed depends on the devices being used.

Some devices use the chip select signal to toggle data.

For example the Maxim Integrated MAX7219 datasheet says "CS must be low to clock data in or out."

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ CS# is very frequently used as the internal device reset signal for its SPI logic as well, so imagine having to power cycle everytime you wanted a new transaction -- bleh! \$\endgroup\$ – Krunal Desai Dec 26 '15 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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