SOFT-SPI on Arduino Nano
-
My goal is to connect an LCD to Arduino Nano. I'm using Arduino Nano because of it's small size. Since SPI port is used by NRF24 module, is it possible to enable SOFT-SPI on arduino nano and connect the LCD to it?
-
@foad62 - what kind of LCD is it?
I used i2c instead to connect my LCD to avoid conflict with SPI and it worked great. (Sorry, dont know the answer to your qustion about soft-spi).
-
It is 1.8" TFT LCD (TFT-LCD-ST7735).
I'm not sure if it supports I2C connection!
-
-
You could try sharing the SPI bus.. In most cases it will work, only W5100 ethernet module is special, in that way it doesn't tri-state the MISO line when it's not deselected with the normal CS line..
Just pick a separate pin for CS for the display, than the one for the NRF module, and configure your TFT library accordingly.
-
@foad62 I don't know if it helps but you can modify the default pins MySensors expects the NRF chip to be connected to. Here is an example, works on my Nano with MySensors 2.0:
#define MY_RADIO_NRF24 #define MY_SOFTSPI #define MY_RF24_CE_PIN 11 #define MY_RF24_CS_PIN 6 #define MY_SOFT_SPI_SCK_PIN 10 #define MY_SOFT_SPI_MISO_PIN 9 #define MY_SOFT_SPI_MOSI_PIN 7 #include <SPI.h> #include <MySensors.h>
In my case I didn't try connecting another SPI device, I just moved the pins for easier NRF soldering on a perfboard.
-
@tbowmo
Thank you. I'll give it a try.