Multiple connections on one Arduino Mega MOSI pin

Hi everyone
can i connect many devices (sensors) on one MOSI, MISO pins that are available on Arduino Mega board? for example i want to connect LoRa 32 module and SD card module to one Arduino Mega kit, both modules have MOSI, MISO pins, can i connect both to single MOSI pin on Mega? and to single MISO pin on Mega?
Best Regards

The answer is yes

SPI is a bus system and multiple devices can be connected to the bus as long as each of them uses a different Slave Select pin so that the active device can be selected

1 Like

So you mean that there will be no interfering between both modules and they work independently from each other, Sir?

As long as you set the state of the SS pin for each device correctly then only one device will be talking to the SPI bus at a time so can transmit and receive data without it interfering with other devices

1 Like

Best Regards , thanks a lot.

Make sure that you have a module that releases the MISO pin when not selected. Cheap crap that keeps the MISO pin in output mode instead of tri-state does exist; it's worth investing in a good one if you don't want to pull your hair out. Check the schematics of what you use, if no schematic is provided, definitely stay away from it.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.