Multiple ST7735 displays on one Arduino Nano

I am trying to connect two ST7735 tft displays to one arduino Nano.
Using the hardware SPI pins I am able to get some information on one or the other tft display.
The CS pin for both displays are on a different nano pin.

It looks like the second init of the tft overwrites the first one.

Following is a test sketch I am using.

#include <SPI.h>
#include <Adafruit_ST7735.h>

#define cs1 10
#define cs2  9
#define dc   8
#define rst  7

Adafruit_ST7735 tft1 = Adafruit_ST7735( cs1, dc, rst);  // declare an instance of the ST7735 
Adafruit_ST7735 tft2 = Adafruit_ST7735( cs2, dc, rst);  // declare an instance of the ST7735 

void setup() {
  SPI.begin();
  tft1.initR(INITR_BLACKTAB);
  tft2.initR(INITR_BLACKTAB);
  tft1.setRotation( 1);
  tft1.fillScreen(ST7735_BLUE);
  tft2.setRotation( 1);
  tft2.fillScreen(ST7735_RED);

}

void loop(){
  tft1.setTextColor( ST7735_WHITE);
  tft1.print(millis());
  tft2.print(millis());
  delay(200);
}

What am I missing? I have seen examples with two different displays, found the haloween eyes sketch but is not suitable for my setup.

Can anyone help me to shed some light on this issue?

Thanks in advance.

When a display is initialised it is reset, since the reset is shared the first display is reset when the second is initialised.

One solution is to connect the reset line of both displays to the RST line of the Nano, then they are only reset at power up or when the reset is triggered during sketch upload.

1 Like

Bodmer, thanks a lot.

I didn't think of that.

It works like a charm.

:smiley:

bodmer:
When a display is initialised it is reset, since the reset is shared the first display is reset when the second is initialised.

One solution is to connect the reset line of both displays to the RST line of the Nano, then they are only reset at power up or when the reset is triggered during sketch upload.

Thank you bodmer.
You save my project.
It works like a charm!

Hi, I really interested in this dual display project. So the code is right, only the hardware part is needed to correct? I did no want to make a new thread bacause I dont want to post same thing over again. Regards.