The sn74hc165 is being fed 5V from an external PSU, btw, with its gnd connected to arduino’s.
Since I know the SS is pin 10 on the ethernet shield I chose pin 9 for the shift register chip.
MOSI, MISO and SCK lines are shared with the ethernet shield.
So I should be safe … i.e. by having one separate SS pin for each.
On executing even the simplest cardinfo example it always fails to initialize if I have the sn74h165 connected. Otherwise it always reads the card.
What do you mean by "connected to buttons"? As long as you don't try to change D4 with your code, and don't connect anything else to it (no switches, etc), you should be ok. But it is the slave select for the SD card, and it will be changing "on its own" when you access the SD card. Actually, the SD library will be changing D4 as it accesses the SD card. It will be set to OUTPUT and HIGH by the SD.begin(4) function call.
SurferTim:
What do you mean by "connected to buttons"? As long as you don't try to change D4 with your code, and don't connect anything else to it (no switches, etc), you should be ok. But it is the slave select for the SD card, and it will be changing "on its own" when you access the SD card. Actually, the SD library will be changing D4 as it accesses the SD card. It will be set to OUTPUT and HIGH by the SD.begin(4) function call.
Maybe it's the 'D' that's complicating...
I use the 74hc165 for connecting 6 buttons for driving a menu/other options on the LCD. Using 6 pins on the Arduino for these buttons seemed a great waste of real estate ...
To be perfectly clear, nothing is connected to Arduino's pin 4.
Your schematic is not "perfectly clear", but if nothing is connected to D4, then it is the 74HC165 pin 9 connected to the Arduino D12 that is the problem. On an SPI device, the MISO pin on each SPI slave device must be tri-state. When you disable the device SPI with the slave select pin, pin 9 on the 74HC165 must become hi-z (like an input). It appears by the datasheet it is always an output. That will cause problems, and probably a failure of one of the devices eventually.
SurferTim:
Your schematic is not "perfectly clear", but if nothing is connected to D4, then it is the 74HC165 pin 9 connected to the Arduino D12 that is the problem. On an SPI device, the MISO pin on each SPI slave device must be tri-state. When you disable the device SPI with the slave select pin, pin 9 on the 74HC165 must become hi-z (like an input). It appears by the datasheet it is always an output. That will cause problems, and probably a failure of one of the devices eventually.
Thanks SurferTim!
I've just tested it and it was in fact 74hc165's pin 9 the culprit...
So the verdict is scratch using this chip in conjunction with other spi devices or is there something I can still do?
Why use SPI on that IC? You know the SPI clock is not a true clock. It doesn't pulse all the time. It only works (pulses) when reading or writing to the SPI bus. Otherwise, it is in a steady state.