Multiple TFT's not displaying

I am trying to connect about 5 TFT's to my Arduino Uno and I got to the point of hooking two of them up without any issues. However, after a code upload, they stopped working. I then took all the code out and tested each in isolation and they still function. However, together only one of them displays data. The TFT's I am using are the ST7789v2 found here. https://www.waveshare.com/wiki/1.69inch_LCD_Module#Hardware_Connection_3

I have wired them up according to the schematic with "all" pins being shared except the CS pin. Each display has its own.

The code looks like this;

#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>

#define TFT_CS1 10
#define TFT_CS2 3

#define TFT_RST        8 // Screens shared
#define TFT_DC         7 // Screens shared
#define TFT_BACKLIGHT  9 // Backlight for all screens

Adafruit_ST7789 tftHour1 = Adafruit_ST7789(TFT_CS1, TFT_DC, TFT_RST);
Adafruit_ST7789 tftHour2 = Adafruit_ST7789(TFT_CS2, TFT_DC, TFT_RST);

Adafruit_ST7789 setupScreen (Adafruit_ST7789 tft){
  tft.init(240, 280);
  tft.fillScreen(ST77XX_BLACK);
  return tft;
}

void setup(void) {
  tftHour1 = setupScreen(tftHour1);
  tftHour2 = setupScreen(tftHour2);
}

void loop(){
  tftHour1.print("1");
  tftHour2.print("2");
}

When this executes, display 2 shows output but display 1 does not. Weirdly if I take the CS from display 1 and pop it into the same line on the breadboard as CS2, and then put it back into its original position, display 1 and 2 seem to work. But only till the next power cycle or upload.

Also oddly, setting the colour of each screen works even if one is blue and the other is say green. Both change to their respective colours. But when I try to write text to them, only one of them has text.

If I comment the code for tftHour2, then tftHour1 starts showing text. If I swap the setup code for ftfHour1 and tftHour2, then the display that is last to init, is the one that shows the text and the other stays blank.

Like I said, I had all this working and then a simple font change upload and it all stopped working.

Any help on this is really appreciated.

I should mention that I am a programmer and very new to electronics so please keep it simple.

#Update . If I have separate RST pins then it works. But I need 5 screen and will run out of pins in that case. Is there a way to get around that?

5 displays is pretty unusual. There might be very good reasons to use 5 displays. It depends on what your project really is.

From the names

I have a question:
Do you build some kind of a clock with big digits?

One problem might be: an arduino has only 2 kB of RAM.
Using a single display is already occupying a lot of RAM. I would not be astonished if the 2 kB of RAM are just too less for 5 pieces 240 x 280 pixel-displays.

But this depends on a lot of factors.
The display seems to be based on a ST7789-driver. Anyway there might be multiple driver-chips working with this library.
You should post the exact type of display that you are using and a datasheet of exact this display.

You should post the compile-log as a code-section that the RAM-usage can be analysed.
You should look yourself at the compile-log to see how much RAM is used.

You should give an overview about your project. I'm very sure that there are at least 5 different solutions for the functionality you want to have.
Which solution fits best to your requirements and possible limitations that you have like available space, budget, etc. can be decided if you have described all these conditions.

best regards Stefan

I posted the exact display as a link and the link even took you to the Arduino section and the schematic I used.

So yes, a clock. H+H+M+M+Date&Temp

I seem to have enough RAM for the project. My question really now is, can more than 1 display share an RST pin or does each display need its own CS and RST?

Is the answer to use a Mux for this?

Do you use a external power-supply for the displays?
You can't use the Arduino's 5V pin to supply more than 4 or 5 small sensors.
These displays will pull too much current from the arduino's 5V pin.

Yes. The CS is short for Chip-Selection.
The SPI-device is selected through changing the voltage on that pin.
Sharing the CS-input means you select all shared SPI-devices at once. The opposite of what you want to do.

For reset it is very likely that you need separate pins too.
This depends on in which situations must a reset be made.

A very simple solution for a loooong display which has enough space for showing HH:MM:SS DD.MM.YYYY 21.5°C all at once or as a running text would be to use these dotmatrix-displays
https://www.makershop.de/display/led-matrix/dot-matrix-modul-8x8-max7219/
you can daisy-chain these modules very easily. They are just connected all together to the same two wires clock and data

best regards Stefan

So that display is not the look I am going for at all.

As for powering, I mentioned that I had it working on two screens but with a font change it all broke. I am still only at the 2 screen stage and there is ample power available for that.

Also, I mentioned that once I separated the RST pins, both screen began working so clearly enough power.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.