Cannot get TFT_eSPI to work on Waveshare RP2040 Zero with 1.47" 172 x 320 ST7789 LCD Screen #3912
dukbilt
started this conversation in
Compatible displays and setup files
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I have attempted to use TFT_eSPI with a Waveshare RP2040 Zero and a 1.47" 172 x 320 ST7789 LCD Screen but can't get it to work. There is no display whatsoever - just a blank screen with no text or colour evident.
I have been successful in getting the LCD Screen and RP2040 to work using the DFRobot_ST7789_172x320_HW_SPI screen library, however.
Any idea as to what's wrong?
RP2040_TFT_eSPI_Colour_Test.ino:
`// Diagnostic test for the displayed colour order by Bodmer 17/2/19 for the TFT_eSPI library: https://github.com/Bodmer/TFT_eSPI
#include <SPI.h>
#include <TFT_eSPI.h> // Hardware-specific library
TFT_eSPI tft = TFT_eSPI(); // Invoke custom library
void setup()
{
tft.init();
tft.fillScreen(TFT_WHITE);
tft.drawRect(0, 0, tft.width(), tft.height(), TFT_GREEN);
tft.setCursor(0, 4, 4); // Set "cursor" at top left corner of display (0,0) and select font 4
tft.setTextColor(TFT_WHITE); // Set the font colour to be white with a black background
tft.println(" Initialised default\n"); // We can now plot text on screen using the "print" class
tft.println(" White text");
tft.setTextColor(TFT_RED);
tft.println(" Red text");
tft.setTextColor(TFT_GREEN);
tft.println(" Green text");
tft.setTextColor(TFT_BLUE);
tft.println(" Blue text");
delay(5000);
}
void loop()
{
tft.invertDisplay(false); // Where i is true or false
tft.fillScreen(TFT_BLACK);
tft.drawRect(0, 0, tft.width(), tft.height(), TFT_GREEN);
tft.setCursor(0, 4, 4);
tft.setTextColor(TFT_WHITE);
tft.println(" Invert OFF\n");
tft.println(" White text");
tft.setTextColor(TFT_RED);
tft.println(" Red text");
tft.setTextColor(TFT_GREEN);
tft.println(" Green text");
tft.setTextColor(TFT_BLUE);
tft.println(" Blue text");
delay(5000);
// Binary inversion of colours
tft.invertDisplay(true); // Where i is true or false
tft.fillScreen(TFT_BLACK);
tft.drawRect(0, 0, tft.width(), tft.height(), TFT_GREEN);
tft.setCursor(0, 4, 4);
tft.setTextColor(TFT_WHITE);
tft.println(" Invert ON\n");
tft.println(" White text");
tft.setTextColor(TFT_RED);
tft.println(" Red text");
tft.setTextColor(TFT_GREEN);
tft.println(" Green text");
tft.setTextColor(TFT_BLUE);
tft.println(" Blue text");
delay(5000);
}`
User_Setup.h:
`// USER DEFINED SETTINGS
// Set driver type, fonts to be loaded, pins used and SPI control method etc.
// User defined information reported by "Read_User_Setup" test & diagnostics example
/* TFT WIRE RP2040 RP2040 This Other
COLOUR (native) (pin #) Definition Pin #
SCLK Brown SPI0 SCK GP2 TFT_SCLK 21 (2u)
MOSI Orange SPI0 TX GP3 TFT_MOSI 20 (3u)
CS Yellow SPI0 CSn GP1 TFT_CS 22 ()
RES Green GP GP6 TFT_RES 17
DC Blue GP GP7 TFT_DC 16
BLK Purple GP GP8 TFT_BLK 15
#define USER_SETUP_INFO "User_Setup"
#define ST7789_DRIVER // or #define ST7789_2_DRIVER // Minimal configuration option, define additional parameters below for this display
//#define RPI_DISPLAY_TYPE // I've tried with this commented out as well - no change
#define TFT_WIDTH 172 // ST7789 172 x 320
//#define TFT_SPI_PORT 0
#define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW)
#define TFT_CS 1
#define TFT_SCLK 2
#define TFT_MOSI 3
#define TFT_RST 6
#define TFT_DC 7
#define TFT_BLK 8 // LED back-light control pin
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT // Comment out stop the SPIFFS filing system and smooth font code being loaded (will save ~20kB of FLASH)
#define SPI_FREQUENCY 25000000`
Beta Was this translation helpful? Give feedback.
All reactions