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 ( Arduino - SPI ), and I found a possible solution here: http://forum.arduino.cc/index.php?topic=360718.msg2942160#msg2942160 . 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?
Thanks for your help!
Write down a full list of pins that you want to use. And post it here.
An SD and a 16x2 should be no problem to find enough different pins.
The SD card will need the SPI pins but the 16x2 can use any pins.
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?
That is why I asked for a full list.
Some items are easier to share pins.
You would get advice. Others might pick up a few tips for their projects.
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.
perfect! I'll try the I2C adapter. Thank you for your help!