for my project I need to use a SD card reader and an LCD 16x2 display, I have both (the reader is a catalex sd card adapter). I tried to run them simultaneously using the same miso-mosi pins, but they don't seem to work together. I know they should work ( SPI - Arduino Reference ), and I found a possible solution here: SOLVED. Nrf24 (Mirf lib) + Micro SD-card works OK together - #9 by someuser - Storage - Arduino Forum . My problem is that I don't have the tools for this patch. Maybe I could change the pins used by the lcd, but I need every single pin, because I use every single of them, and I don't want to buy a bigger board for it.
So I have 2 questions:
Is there a programmatic solution, so I don't have to buy anything?
If opt. 1 is impossible, can you suggest a card reader, which can share pins with my display?
thank you for your reply! I know, that these 2 need less pins, then my board has (I use a pro micro), but my problem is that I will use a lot more other tools as well (buttons, buzzer, rtc modul), and the pins will be enough only if I manage to use the same SPI pins. Is that possible?
A Nano seems to have 30 pins. Giving you the regular Uno 20 GPIO + 2 extra Analog.
A Micro seems to have 24 pins. You get less GPIO pins. 3 GND pins seems wasteful.
Yes, you can probably share some pins but you will need to be careful how they are used.
e.g. MOSI, SCK with the LCD
Or you could put all 4 buttons on a single Analog pin.
Or an SPI RTC could share the SPI bus with the SD.
But the simplest solution of all: Use an I2C Adapter on your LCD.
An I2C RTC could share the I2C bus.