I have an application which requires both an LCD display and a MicroSD breakout board connected to a arduino nano.
The problem I have is that both of these components require the use of digital pins 11 (MOSI) and 12 (MISO), therefore is it possible to have both of these components in the same circuit and if yes, how would I go about doing it?
I have provided the links to the components below:
evans123:
Thanks. I think I'll need to use the SPI protocol then as I've got a BMP085 barometric pressure sensor connected using the I2C pins.
Actually you can't. I believe on the Nano, SPI uses pins 10-13. However, I2C is a bus, and you can connect multiple devices on the bus, as long as each device has a different address.
evans123:
Thanks. I think I'll need to use the SPI protocol then as I've got a BMP085 barometric pressure sensor connected using the I2C pins.
Actually you can't. I believe on the Nano, SPI uses pins 10-13. However, I2C is a bus, and you can connect multiple devices on the bus, as long as each device has a different address.
evans123:
How do you connect multiple devices to the bus?
I haven't done it myself, but I believe you just connect all of the like wires together (all grounds, all 5 volts, all SDAs, all SCLs). Because each device has an address, it will only return the data, when the Arduino sends its address over the wire.
Actually you can connect multiple devices via SPI if they have CS pins, you connect each device to a different digital pin, and your sketch pulls one or the other CS pin down to alternate between the devices.
Ciao,
Lenny
evans123:
I have an application which requires both an LCD display and a MicroSD breakout board connected to a arduino nano.
The problem I have is that both of these components require the use of digital pins 11 (MOSI) and 12 (MISO), therefore is it possible to have both of these components in the same circuit and if yes, how would I go about doing it?
Yes. This is what the 'slave select' part of SPI is all about - you select the device you want to talk to out of the multiple devices connected to MOSI/MISO/CLOCK