Flickering Mini PiTFT 1.14" with ST7789 library

#define TFT_CS        10
#define TFT_RST       -1 // -1 for unused
#define TFT_DC         8

const uint16_t  Display_Color_Black        = 0x0000;
const uint16_t  Display_Color_Blue         = 0x001F;
const uint16_t  Display_Color_Red          = 0xF800;
const uint16_t  Display_Color_Green        = 0x07E0;
const uint16_t  Display_Color_Cyan         = 0x07FF;
const uint16_t  Display_Color_Magenta      = 0xF81F;
const uint16_t  Display_Color_Yellow       = 0xFFE0;
const uint16_t  Display_Color_White        = 0xFFFF;

uint16_t        Display_Text_Color         = Display_Color_White;
uint16_t        Display_Backround_Color    = Display_Color_Black;

Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST); // Hardware SPI init

void setup() 
{
  tft.init(135, 240);   
  tft.setFont();
  tft.setRotation(135); // 135 or 45
  tft.fillScreen(Display_Backround_Color);  
  tft.setTextColor(Display_Text_Color);
  tft.setTextSize(2);  

  tft.print("TEST");
}

Should output TEST and that's it, but flickers and only shows the text if I press the Reset button on the R4 Wifi. The same code is working fine on a e.g. Arduino Nano.

Do I have to use another SPI mode (although tried everything) or adjust the SPI speed?

Thank you!

I have also created a new Issue on github (ST7789 library) : Flickering Mini PiTFT 1.14" on Uno R4 Wifi · Issue #188 · adafruit/Adafruit-ST7735-Library · GitHub

Here is the pinout of this display: Pinouts | Adafruit Mini PiTFT - Color TFT Add-ons for Raspberry Pi | Adafruit Learning System

Any news here?

Thanks!

Works for me:
Note: rotation can only be 0, 1, 2, 3

I changed colors:

#include <Adafruit_ST7789.h>
#define TFT_CS        10
#define TFT_RST       -1 // -1 for unused
#define TFT_DC         8

const uint16_t  Display_Color_Black        = 0x0000;
const uint16_t  Display_Color_Blue         = 0x001F;
const uint16_t  Display_Color_Red          = 0xF800;
const uint16_t  Display_Color_Green        = 0x07E0;
const uint16_t  Display_Color_Cyan         = 0x07FF;
const uint16_t  Display_Color_Magenta      = 0xF81F;
const uint16_t  Display_Color_Yellow       = 0xFFE0;
const uint16_t  Display_Color_White        = 0xFFFF;

uint16_t        Display_Text_Color         = Display_Color_Red;
uint16_t        Display_Backround_Color    = Display_Color_Blue;

Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST); // Hardware SPI init

void setup() 
{
  tft.init(135, 240);   
  tft.setFont();
  tft.setRotation(1); // 135 or 45
  tft.fillScreen(Display_Backround_Color);  
  tft.setTextColor(Display_Text_Color);
  tft.setTextSize(2);  

  tft.print("TEST");
}

void loop() {

}

I am running on a MINIMA. My Wifi one has other stuff hooked up.

DO you have the display made by Adafruit?

Thx but we have two differences in our hardware:

I can still only see the text when the Reset button is pressed.

Should not matter if WIFI or MINIMA, but could try either...

You are right I don't have one of these... I have many others that Adafruit sells.

Also hard to know what is happening without seeing your wiring and the like. For example what is connected to backlight pin...

This is my wiring:


(without I²C)

Maybe a voltage issue? display is setup for 3.3v IO and you are giving it 5v? On an Adafruit forum was posting about different PITFT and was mentioned you could fry it without level converter

Don't think so:

image

The weird thing is, as mentioned, that the same display works flawless on Arduino Uno / Nano.

As you said the 5v in is for specific stuff... But the IO levels going to the display are +5v from the IO pins.
From this displays schematic


Where if you use their Arduino version, they go through level shifters:

Can not say for sure that is the issue, but I know some other Adafruit ST7789 displays are working.

Not sure if anything else I could do. So good luck

One other thing... When you say flicker, is the display actually working, but not working well, and only readable when reset?

Maybe it is because the SPI transfer code to update the screen, is not fast... Read that as :snail:

Wonder if I should make a version of our Teensy version of the ST7789 library like I did for the ILI9341 as discussed in the thread:

Edit: Oops, don't remember if I made it work for UNO R4... Did for GIGA and Portenta

Yes I can see "TEST" when I click the Reset button, so the display itself works. What should I test / modify?
(this is why I added the comment if anything with SPI needs to be adjusted)

Thank you very much.

Not sure: again this is using your sketch, except I added the missing lines (#include loop()...)
And I have Reset connected...

As I mentioned SPI is not overly great, it is only using about 1/5th the speed

Note: I only connect +5v on this board as it level shifts down to 3.3v...
Also I use +5v not VIN

Not sure what else.

Thx, I would connect the RESET line but not sure which pin on the MiniPi TFT (according to the pinout there is no one => it's a different display).

My question what should I test next was related to "Maybe it is because the SPI transfer code to update the screen, is not fast... Read that as :snail: Wonder if I should make a version of our Teensy version of the ST7789 library like I did for the ILI9341 as discussed in the thread".