-1

I'm new to the field: I'm trying to drive a TFT ST7735S display (this is the model I'm currently using: https://www.amazon.it/dp/B078JBBPXK/ref=pe_24968671_487022601_TE_SCE_dp_1) with an Arduino Mega following this video (https://www.youtube.com/watch?v=iPeukOK6stk&ab_channel=Artigiano2.0-AlessioRomanelli). Once the hardware is set up and the code is written, when I run the example script "graphictest" of the Adafruit library for st7735 and st7789, the display shows stripes on the background as shown in the picture below:

enter image description here (Note that the strange effect is not camera's fault)

Reading online I thought that the problem could be the fact that the display is powered with 5V instead of 3.3V, but I've also tried powering it with 3.3V (Arduino Mega 3.3V) with little to no changes. I've changed the tft.initR(INITR_BLACKTAB); to tft.initR(INITR_GREENTAB); too, as suggested by a user i this thread (https://forum.arduino.cc/t/bugged-1-8-inch-tft-diplay/1012166/5) and i've also tried powering the display with 5V but using 4.7k resistors in series to reduce the voltage as suggested in the same post, but it still doesn't work.

Moreover the strange effect that the image shows does only appear, if I use a 5V supply, just when the program executes the void setup() function, then becomes sharp (this does not happen if I power the display using the Arduino Mega 3.3V output supply: in fact in this case the stripes are still present even when entering the void loop() function)

As I said before, the program and the hardware setup arethe same as the video I was talking about. One thing I noticed is that, when I press the reset button on the Arduino Mega, an instant before the program is reloaded, the stripes disappear leaving the image as sharp as it should have been, without any strange background effect. Does anyone have any idea on how to solve this issue?

Thank you in advance for any eventual answer!

EDIT:

This is the picture of the modified verison of the connections, running the graphictest program with the suggested code:

#else
  // For the breakout board, you can use any 2 or 3 pins.
  // These pins will also work for the 1.8" TFT shield.
  #define TFT_CS        10
  //#define TFT_RST        9 // Or set to -1 and connect to Arduino RESET pin
  #define TFT_RST        8 // Or set to -1 and connect to Arduino RESET pin
  #define TFT_DC         9
#endif

// OPTION 2 lets you interface the display using ANY TWO or THREE PINS, // tradeoff being that performance is not as fast as hardware SPI above.

#define TFT_MOSI 11  // Data out
#define TFT_SCLK 13  // Clock out

// For ST7735-based displays, we will use this call
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

enter image description here

Hopefully every connection is visible

6
  • why are you trying to power the LCD with 3.3 V supply? ... the diagrams on the Amazon page clearly show a 5 V supply connection
    – jsotola
    Commented Feb 11, 2023 at 16:56
  • In fact, I did power it with 5V supply, but after reading online it seemed (mainly from the thread I pointed in the question) that 5V could damage the display. Nevertheless I tried it all and even if powering it with 5V the problem remains.
    – Luke__
    Commented Feb 11, 2023 at 16:58
  • you said that you connected some series resistors ... that's not powering it with a 5 V supply
    – jsotola
    Commented Feb 11, 2023 at 17:01
  • after the problem showed when supplying 5V directly I both tried powering it using 3.3V and 5V reduced to 3.3V using resistors. But the problem showed by powering it with 5V in the first place
    – Luke__
    Commented Feb 11, 2023 at 17:02
  • did it ever work correctly?
    – jsotola
    Commented Feb 11, 2023 at 17:05

3 Answers 3

0

Adafruit made that graphictest program for screens that they sell. The screen that you have is not sold by Adafruit and there is no reason why they should support that screen.

Still, you can get it to work, if it is not bricked. After you see enough variants, you get an idea about what you need to get them to work. So, I suggest the following.....

Go here https://www.arthurwiz.com/software-development/177-inch-tft-lcd-display-with-st7735s-on-arduino-mega-2560 and hook up the screen to your mega just exactly as in their table. You will make 8 connections. Download and execute their 'Hello World' program from the tutorial. If that runs ok, then you know that the connections are correct. Note that the constructor is:

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

Also, don't worry if the screen is not rotated correctly - you can add one line in setup() to fix that:

  tft.initR(INITR_BLACKTAB);
  tft.setRotation(1); // <---added
  tft.fillScreen(ST7735_BLACK);

Now on to graphictest. Find these lines and change them to how I have them. I left one line commented out to illustrate. You do this to identify which GPIO go with which function. Yes, I could have started here, but going through the first tutorial successfully means you have not bricked the screen and you have the connections correct.

#else
  // For the breakout board, you can use any 2 or 3 pins.
  // These pins will also work for the 1.8" TFT shield.
  #define TFT_CS        10
  //#define TFT_RST        9 // Or set to -1 and connect to Arduino RESET pin
  #define TFT_RST        8 // Or set to -1 and connect to Arduino RESET pin
  #define TFT_DC         9
#endif

You will use Option 2 and the constructor as stated previously - so

// OPTION 2 lets you interface the display using ANY TWO or THREE PINS,
// tradeoff being that performance is not as fast as hardware SPI above.
#define TFT_MOSI 11  // Data out
#define TFT_SCLK 13  // Clock out

// For ST7735-based displays, we will use this call
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

// Use this initializer if using a 1.8" TFT screen:
  tft.initR(INITR_BLACKTAB);      // Init ST7735S chip, black tab

Note that even though my screen still has a green tab, if I use the green tab initializer, I will have offset problems.

Make sure you haven't left any other configuration lines uncommented. I have the same screen and just hooked it up and tested all of this and everything works fine.

enter image description here

Let us know how it goes.

Edited to add:

You do not need to add ANY external resistors. Your Mega has connections for both 3V and 5V and you need to use both voltages.

Your initial pic (see below) shows that both pin 2 and pin 8 are connected to the same +V on the rail of the breadboard. This is incorrect. As shown in the table I linked, Pin 2 on the LCD goes to 5V on the Mega and pin 8 on the LCD goes to 3.3V on the Mega.

enter image description here

9
  • Thank you very much: I will try and let you know how it goes as soon as possible. In the mean time I have tried something myself: I read online that the screen, even if supplied with 5V requires 3.3V logic, thus I included 1k resistors in series with the SPI pins and the problem seems to be fixed even though the screen has become unstabile (flashy and often decays to a white screen before the end of the executiom of the setup function). I can't tell if this happens because of the fragility of breadboard connections or for any other kind of reason)
    – Luke__
    Commented Feb 13, 2023 at 5:55
  • I've tried to hooke the LCD up like you suggested, but there are two main problems: the background still isn't fixed and the speed at which the lcd refreshes has significantly decreased. In other words the background that should be black starts as white and slowly becomes grey but never black
    – Luke__
    Commented Feb 13, 2023 at 17:09
  • @Luke__ assuming you have proper connections and are not using any added resistors and no breadboard / lead problems, I wonder if your screen is not the problem. A nice clear pic of the screen and the mega connections might help. Did the "hello world" program run ok?
    – DrG
    Commented Feb 13, 2023 at 17:15
  • @Luke__ Please make sure you are correctly connecting SEPARATELY +5V AND +3.3V from the Mega to the correct connections on the screen - see my edit in the initial answer.
    – DrG
    Commented Feb 13, 2023 at 17:58
  • The "hello world" showed the same problems. I've edited the question with the requested picture showing the graphictest program in execution. I think I connected all correctly, tell me if I'm I'm wrong
    – Luke__
    Commented Feb 13, 2023 at 18:11
1

I had the exact same issue, and tested the things here but it did not help. Then I pressed the reset button on my UNO with the same result as Luke__ had (the screen looked nice as long as I pressed the reset). After doing that a few times the display started to work as it should.

Strange, but resolved my issue.

1

I experienced the same problem. I bought an ST7735S from Amazon, labelled as 'ST7735S 3.3V'. It showed banding even when powered with the 3.3V pin from an Arduino Nano so I realised that the digital outputs from the Nano were also at 5V. I used a TXS0108E logic level converter to bring the outputs from the Nano down to 3.3V and the display works perfectly - problem solved.

I can show you my circuit on Fritzing if it would help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.