Problems with ESP32-S3 N16R8 UNO Board with 4" ILI9486 320x480 RPI-Display #3756
Unanswered
derhopp
asked this question in
Q&A - General
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.
-
Hi everyone,
I am desperately trying get my ESP32-S3 N16R8 UNO board with an 4" ILI9486 320x480 RPI-display running. It was so far successfully running with a Wemos ESP32 D1 R32 UNO board.
I am using TFT_eSPI in version 2.4.74 in platfomio.
While using TFT_eSPI I only get a white screen, no crash. The read back test also does not read back anything useful.
The connections are running as a direct spi-setup is working without problems (wonderful full screen colours). Everything is done with the attached code.
I already tried the setting USE_FSPI_PORT, DUSE_HSPI_PORT, DUSE_VSPI_PORT as well as w/ or w/o RPI_DISPLAY_TYPE with the same results just getting a white screen.
I home someone can help me.
Best regards
derhopp
main.cpp
`
#define USE_TFT_ESPI
//#define TFT_WIRTE_TEST
#if defined USE_TFT_ESPI
#include <TFT_eSPI.h> // Include the graphics library
TFT_eSPI tft = TFT_eSPI(); // Create object "tft"
void setup(void)
{
pinMode(TFT_BL, OUTPUT);
Serial.begin(115200);
delay(1000);
Serial.println("Boot...");
tft.init();
tft.setRotation(1);
tft.fillScreen(TFT_DARKGREY);
tft.setTextFont(2);
for(uint8_t ch=0; ch<3;ch++)
{
digitalWrite(TFT_BL,LOW);
Serial.println("BL OFF");
delay(150);
digitalWrite(TFT_BL,HIGH);
Serial.println("BL ON");
delay(150);
}
}
void loop()
{
Serial.print("\n\n\n");
Serial.println("Looping...");
Serial.println("RED");
tft.fillScreen(TFT_RED);
tft.setCursor(TFT_HEIGHT/2,TFT_WIDTH/2);
tft.print("RED");
delay(2000);
Serial.println("GREEN");
tft.fillScreen(TFT_GREEN);
tft.setCursor(TFT_HEIGHT/2,TFT_WIDTH/2);
tft.print("GREEN");
delay(2000);
Serial.println("BLUE");
tft.fillScreen(TFT_BLUE);
tft.setCursor(TFT_HEIGHT/2,TFT_WIDTH/2);
tft.print("BLUE");
delay(2000);
}
#elif defined TFT_WIRTE_TEST
// Walking 1 write and read pixel test
#include <TFT_eSPI.h>
#include <SPI.h>
#define TDELAY 500
TFT_eSPI tft = TFT_eSPI();
void setup() {
Serial.begin(115200);
tft.init();
tft.fillScreen(0xF81F);
}
void loop() {
static uint32_t wr = 1;
static uint32_t rd = 0xFFFFFFFF;
delay(TDELAY);
tft.drawPixel(30,30,wr);
Serial.print(" Pixel value written = ");Serial.println(wr,HEX);
rd = tft.readPixel(30,30);
Serial.print(" Pixel value read = ");Serial.println(rd,HEX);
if (rd!=wr) {
Serial.println(" ERROR ^^^^");
//while(1) yield();
}
else Serial.println(" PASS ");
// Walking 1 test
wr = wr<<1;
if (wr >= 0x10000) wr = 1;
}
#else
#include <Arduino.h>
#include <SPI.h>
SPIClass spi = SPIClass(FSPI); // oder VSPI, je nach ESP32-Modell
void sendCommand(uint8_t cmd) {
digitalWrite(TFT_DC, LOW); // Kommandomodus
digitalWrite(TFT_CS, LOW);
spi.transfer(cmd);
digitalWrite(TFT_CS, HIGH);
}
void sendData(uint8_t data) {
digitalWrite(TFT_DC, HIGH); // Datenmodus
digitalWrite(TFT_CS, LOW);
spi.transfer(data);
digitalWrite(TFT_CS, HIGH);
}
void resetTFT() {
digitalWrite(TFT_RST, LOW);
delay(50);
digitalWrite(TFT_RST, HIGH);
delay(120);
}
void fillColorRGB888(uint8_t r, uint8_t g, uint8_t b) {
sendCommand(0x2A); // Column Address Set
sendData(0x00); sendData(0x00);
sendData(0x01); sendData(0x3F); // 319
sendCommand(0x2B); // Page Address Set
sendData(0x00); sendData(0x00);
sendData(0x01); sendData(0xDF); // 479
sendCommand(0x2C); // Memory Write
digitalWrite(TFT_DC, HIGH);
digitalWrite(TFT_CS, LOW);
for (uint32_t i = 0; i < 320UL * 480UL; i++) {
spi.transfer(r);
spi.transfer(g);
spi.transfer(b);
}
digitalWrite(TFT_CS, HIGH);
}
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("Start SPI TFT Color Test");
pinMode(TFT_CS, OUTPUT);
pinMode(TFT_DC, OUTPUT);
pinMode(TFT_RST, OUTPUT);
pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, HIGH);
digitalWrite(TFT_CS, HIGH);
digitalWrite(TFT_DC, HIGH);
digitalWrite(TFT_RST, HIGH);
spi.begin(TFT_SCLK, TFT_MISO, TFT_MOSI, TFT_CS);
spi.beginTransaction(SPISettings(20000000, MSBFIRST, SPI_MODE0));
resetTFT();
sendCommand(0x3A); // Set color mode
sendData(0x66); // 18-bit color (RGB666)
sendCommand(0x11); // Sleep out
delay(120);
sendCommand(0x29); // Display on
delay(10);
}
void loop() {
Serial.println("RED");
fillColorRGB888(255, 0, 0); // Red
delay(1000);
Serial.println("GREEN");
fillColorRGB888(0, 255, 0); // Green
delay(1000);
Serial.println("BLUE");
fillColorRGB888(0, 0, 255); // Blue
delay(1000);
Serial.println("BLACK");
fillColorRGB888(0, 0, 0); // Black
delay(1000);
Serial.println("WHITE");
fillColorRGB888(255, 255, 255); // White
delay(1000);
}
#endif`
platfomio.ini
`; PlatformIO Project Configuration File
[env:esp32-s3-devkitc-1]
framework = arduino
platform = espressif32
;;; ESP32 N16R8
board = esp32-s3-devkitc-1
board_build.arduino.memory_type = qio_opi
board_build.flash_mode = qio
board_build.psram_type = opi
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_build.partitions = default_16MB.csv
board_build.extra_flags = -DBOARD_HAS_PSRAM
board_build.mcu = esp32s3
board_build.f_cpu = 240000000L
board_build.filesystem = littlefs
monitor_speed = 115200
upload_speed = 460800
build_flags =
-Os
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
-DUSER_SETUP_LOADED=1
-DRPI_DISPLAY_TYPE=1
-DILI9486_DRIVER=1
-DTFT_WIDTH=320
-DTFT_HEIGHT=480
-DTFT_MISO=13
-DTFT_MOSI=11
-DTFT_SCLK=12
-DTFT_CS=10
-DTFT_DC=14
-DTFT_RST=21
-DTOUCH_CS=19
-DTFT_BL=46
-DLOAD_GLCD=1
-DLOAD_FONT2=1
-DLOAD_FONT3=1
-DLOAD_FONT4=1
-DLOAD_FONT5=1
-DLOAD_FONT6=1
-DLOAD_FONT7=1
-DLOAD_FONT8=1
-DLOAD_GFXFF=1
-DSMOOTH_FONT=1
-DSPI_FREQUENCY=20000000
-DSPI_TOUCH_FREQUENCY=2500000
; -DUSE_FSPI_PORT=1
[platformio]
src_dir = src
`
Beta Was this translation helpful? Give feedback.
All reactions