Hi, everybody! I'm using Arduino Due, this is very cool board, it provides as much as 3 pins for slave selection, so I can attach 3 devices to SPI. But, I think, I'm possible to attach even more!
CS signal is very simple, just high or low. So, I can manually select the appropriate device with digitalWrite() and than just call SPI.transfer(4, 0x00); (pin 4 is not connected to anything). This way I can attach very many SPI slaves to arduino.
I don't have experience with the Due nor with SPI but you seem to be using the extended spi functions. You can live without them and use the normal functions as described in spi library.
Using the existing 'special' CS pins, you can hook them up to a 3-to-8 address decoder and have eight CS lines.
kvadrug:
...nor with reading first post in the topic In a few words I talk about working with SPI using normal digital pins instead of 'special' ones.
I doubt that You want multiple CS lines so you can add more SPI devices. The current 3 lines limit you to 3 devices (one for each of the special CS). Don't use them in the 'special' mode, but use them as an address bus (3 lines; normal digital outputs); you can actually use any three pins. Hook them up to a 3-to-8 address decoder and you will have 8 CS lines.
// Edit
1)
Example decoder: 3-to-8 Line Decoder
3)
And as stated, use the normal SPI; use SPI.begin() instead of SPI.begin(n) and as far as I understand it use SPI.transfer(data) instead if SPI.transfer(n, data). Might require some more changes but as also stated, not familiar with Due or SPI.
sterretje, you don't even try to understand my idea of extending arduino spi abilities without any external decoders. Using external Decoder is too obvious and boring.
kvadrug:
sterretje, you don't even try to understand my idea of extending arduino spi abilities without any external decoders. Using external Decoder is too obvious and boring.
Sorry if it looks / sounds like that; I did not understand that you wanted to waste IO pins My whole point when I started writing the first reply was that I don't see a reason to use the extended capabilities and waste a pin on that.