Multiple SPI Devices on Arduino Uno

Hi all,

I'm still relatively new to Arduino and SPI. I have a small Ethernet shield (same as seen here) and a SainSmart Max6675 thermocouple. I would like to hook both up to my Arduino Uno.

Ideally, the sensor would take in data and routinely send temperature updates through Ethernet.

How would I connect both of these at once?

Thank you

How would I connect both of these at once?

Each device on the bus needs to have a separate slave select pin. The device whose slave select pin is LOW gets the data.

PaulS: Each device on the bus needs to have a separate slave select pin. The device whose slave select pin is LOW gets the data.

I see! I had read something like that, but wasn't sure how to implement. Are there any pins that are "out of bounds" for being slaves?

Also, I'm not sure which pin is currently my slave select for the thermocoupler (which I have set up). Here's the code:

int thermo_gnd_pin = 8; int thermo_vcc_pin = 9; int thermo_so_pin = 12; int thermo_cs_pin = 10; int thermo_sck_pin = 13;

I read that cs is chip select. Is that the same as slave select??

Are there any pins that are "out of bounds" for being slaves?

Well, obviously the MISO, MOSI, and CLK pins (11, 12, and 13 are off-limits. Pin 10 defines the Arduino as an SPI master, and is the slave select pin for the Ethernet shield, so it is not available, either. The hardware serial pins are not good choices, either. All other pins (including the analog pins) are available.

Also, I'm not sure which pin is currently my slave select for the thermocoupler (which I have set up). Here's the code:

Looks like you are trying to use pin 10 as the slave select pin for the thermocouple, which won't work when the Ethernet shield is using that pin.

On the Uno, pin 10 has to be an output if you are using SPI as an SPI master, whether or not you choose to use it as the slave select pin. Plus what PaulS said.