Sign up ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

I have worked on SPI devices connected with an Arduino one at a time. How do I work with two different SPI devices at the same time?

share|improve this question

1 Answer 1

Assuming you just want to connect two SPI slave devices to the SPI bus and use them in a mutually exclusive way under software control, with the Arduino as the master, then you just need to make sure you use a different pin for the slave select (SS) on each SPI device.

When you want to talk to one slave, you hold its SS low and drive the other high. Do the opposite to talk to the other slave.

There are some devils in the detail using multiple slaves, and these are explained in more depth here, but in general, it's quite common and OK to use more than one SPI device as a slave.

This blog post will give you more information and is a good place to start reading.

share|improve this answer
    
By design you have to connect MOSI/MISO/SCK in parallel for multiple slave except for the SS. You could use shift register circuit/IC to use a daisy chain connection on slave for SS line. – wajatimur Feb 4 at 17:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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