Can an Arduino and another device communicate via SPI if they have different power supplies (the grounds are connected). If so, do I need to do anything special, e.g. force MISO to INPUT_PULLUP etc.?
I'm trying to get a Teensy to communicate with a TI CC3000 and the wiring checks out but I'm not getting a valid reply to the init string. The CC3000 wants about 300mA @ 3.3V and the Teensy can only supply about 100mA so I'm using a LD1117V33 to power it. (I'm using the Teensy because it has (relatively) gobs of RAM and runs at 3.3V natively so I don't have to do any IO level shifting).
As long as the teensy has 5V tolerant inputs (or you're using some kind of level shifter to get the 5V from the Arduino down to 3.3V for the teensy's inputs), and the teensy outputs data that is within the spec of the Arduino's inputs (LOW < 0.3Vcc, HIGH > 0.6Vcc) then it should be perfectly fine.
majenko:
As long as the teensy has 5V tolerant inputs (or you're using some kind of level shifter to get the 5V from the Arduino down to 3.3V for the teensy's inputs), and the teensy outputs data that is within the spec of the Arduino's inputs (LOW < 0.3Vcc, HIGH > 0.6Vcc) then it should be perfectly fine.
There is no level shifting. Both devices are running at 3.3V. (different power supplies + common ground, but same voltage).
majenko:
As long as the teensy has 5V tolerant inputs (or you're using some kind of level shifter to get the 5V from the Arduino down to 3.3V for the teensy's inputs), and the teensy outputs data that is within the spec of the Arduino's inputs (LOW < 0.3Vcc, HIGH > 0.6Vcc) then it should be perfectly fine.
There is no level shifting. Both devices are running at 3.3V. (different power supplies + common ground, but same voltage).
Then there is absolutely no reason for this not to work.
How close are the devices? Are they on the same circuit board or linked by short wires? SPI doesn't much like long distances without the right kind of wires (e.g., more than a few inches when using ribbon cable etc).
You should connect resistors in series with the wires between the devices, so that when only one of them is powered up, it doesn't supply too much power to the other one through the pin protection diodes. Other than that, it should work. I suggest resistors of about 3.3K to limit the pin current to 1mA. To avoid wiring capacitance and the resistor from limiting the SPI speed too much, position each resistor close to the device which takes that signal as in input.