Hello,
I hope this message finds you well. I have a question regarding the use of a single SD card module with two Arduino Unos.I've wired the SD card module in parallel to both Arduinos. The setup involves two button switches: one button triggers one Arduino to read data from the SD card, and after completing the reading process, it closes the file. The other button triggers the second Arduino to write data to the SD card, and it also closes the file upon completion.
Is this configuration feasible, and are there any potential issues I should be aware of ?
Thank you!
The obvious question is. why use two Unos in the first place ?
It is feasible. Make sure that your protect any Arduino outputs. It's unhealthy for both if one makes e.g. the SCK line high and the other one at the same makes it low; it will probably also result in data corruption.
Is it advisable? Not really in my opinion.
Because I'm running out of inputs and outputs
Shift registers, I2C/SPI port expanders and (analogue) multiplexers are a possible (and more feasible) solution. A bigger board like a Mega as well.
For PWM outputs you can get external modules as well (16 PWM outputs).
If push really comes to shove, just use one Uno to interface with the SD card and have have the other one communicate with it.
The SD card uses the SPI interface, If you connect the two SPI interfaces together you don't an SD card in order to transfer data, just make one Arduino the Master and the other the slave.