SPI Multiple Shields Collision? SD CAN Thermocouple

I am having a problem with running multiple shields at once via SPI. They are assigned separate CS pins, but share the same SPI connections. The shields are:

  1. Arduino Uno R3
  2. SeeedStudio CAN Shield v1.2
  3. SeeedStudio SD Card Shield v3.1
  4. Thermocouple via MAX31855

I know that I am able to operate the CAN shield and the Thermocouple IC together with no problem. However, whenever I add the SD shield, the Thermocouple IC looses communication. I remove the CAN shield from the combination and this doesn’t affect anything. It seems to be a problem of the SD card shield working with the thermocouple IC. Does anyone have any experience with this?

I have checked the SPI settings in the various libraries to the best of my abilities and it seems they are compatible. I am intimidated by the complexity of the SDfat library though, so I’m not 100% on it. I am going to attach two versions of my sketch:

  1. CAN_Thermo_Shield (this works, only CAN shield and thermocouple connected)
  2. CAN_Thermo_Shield_SD (this doesn’t work, it is supposed to be all shields together)

I will also include copies of the libraries I am using:

  1. Adafruit_MAX31855
  2. CAN_BUS_Shield
  3. SDfat

Thanks so much for any help you can provide!

CAN Thermo SD.zip (146 KB)

What SPI chip select pins do each of the devices use?

Thanks for the response.

Uses pin9 for CS - SeeedStudio CAN Shield v1.2 Uses pin10for CS - SeeedStudio SD Card Shield v3.1 Uses pin8 for CS - Thermocouple via MAX31855

This should match the code.

Any further suggestions?

Does the SD shield (and the Thermocouple shield for that matter) properly tri-state the MISO signal when it’s deselected?

Got a schematic?