I am trying to get only 2 SPI devices to work on my UNO board, so if you say I can have 17, I should be able to get it to work, right? Can you please give me some advice on the part where you say the libraries need tweaking for that. Where do I start with that?
I have two shields, both using 10-13 for SPI communication. Now for 1 shield I want to change the SS/CS pin from 10 to another one. I will start by just putting 1 shield on the UNO and trying to get it working using another pin for SS/CS. The library files for my shield are in attachment of this message, I already found out that the SS/CS should be changed in the file "mcp_can_dfs.h". But after doing this, recompiling/flashing and connecting pin 10 of the shield to the new pin on which I address the SS/CS, nothing happens anymore. It is not working. I went a bit deeper into the topic and so I found the file "pins_arduino.h" in the root-folder of Arduino. There is also a definition for pin 10: static const uint8_t SS = 10; I tried changing this to the desired pin number, BUT I could not save it, because the whole Arduino folder is Read-Only. Tried changing this but without any success.
Any tips on this topic?
Uno can have 17 different SPI devices, 3 pins go to each device- SCK, MOSI, MISO - leaving up to 17 free for chip select/slave select. Keep 2 back for Serial port for debugging, still leaves 15.
Libraries might need tweaking to support that. And if using shields, may have to do some cuts & jumpers to make sure pins are not conflicting.
Why not have the master poll the slaves for data?
Master: "#1, got data?"
Master: "#x, got data?"
#x: "Yes, here it is"
Master: "#x, data received".
Then Master sends out via ethernet as needed. Can also be used to ensure each field device is still active.