Two CAN-Shields and one UNO?

Hello loovee,

I am trying to stack a CAN-bus shield together with a WiFi Shield on an Arduino UNO R3. The thing is, they both use pin 10 for SS/CS. To start I am just trying with only my CAN-bus shield connected to the UNO and trying to get the communication working using another pin for the SS/CS than pin 10. On the Hardware side it is not a big problem, but I am a bit lost on the Software side.

You said that I should put the following in my code:

digitalWrite(10, HIGH);
digitalWrite(9, LOW);

But where exactly do I have to put this? And I do not really understand what this changes to the behavior of the SPI bus.

I thought I had to change “#define SPICS 10” into “#define SPICS 9” in the library file “mcp_can_dfs.h”. But after doing this it is not working anymore. If I reconnect it to pin 10, like it originally was, it also is not working anymore, which means the change is doing something,… but it seems that this is not enough to get pin 9 working as the SS/CS pin,…

I really need some help here :slight_smile:

Thank you.