Hi, I am running out of pins and a thought occoured to me that it should be possible to combine the required CS pins from multiple SPI interface requirements with a logic chip. The new Ethernet Shield uses 10 and 4 for ethernet and sd card respectively and I will be needing some more SPI's without losing all the available digital lines to do other things.

The idea is to use three digital pins as a binary number, which it should be possible to decode with a TTL chip to 8 lines. (now perhaps you don't want to use 000 so you can have an all off) I know this would mean a circuit board between the Uno and the shields but that would also allow A0 and A1 to be recovered for analog input with out cutting the pins off the back of the ethernet shield. Also there would need to be a routine to switch the SPI between whatever you wanted to talk to rather than just switching individual pins ( high ; do something; low). You probably have to go through the 000 state in each transition to make sure that no chip is listening before activating the next one.

Can anybody see anything wrong with this basic idea? or are switch on switch off functions already buried so deeply into the libaries that they would be dificult to doctor?

I Thought that the idea would lead to hacking the Ethernet,SD libaries if I can avoid that then I will 'nonstandard' is always trouble. I'm trying to build an enviromental controller that uses PT1000 temperature sensors (for compatable with other things on site and eventually cut down the variety of spares needed) so I need all 6 analog inputs!! Hence the idea of separating the ethernet shield and uno with a custom board. Plus a local LED display is out the window unless I can get one with a SPI rather than a I2C interface. Trouble is I need all the uno's digital lines to drive relays for interfacing to the dreaded 240V.To be fault tolerant I don't want to multiplex the relay drives, if something dies then they all need to failsafe. I do'nt know how long this is going to take now. All other ideas welcome.