Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TFT and WiFi conflict on ESP32 UWB #3558

Open
SelyaRFP opened this issue Nov 20, 2024 · 0 comments
Open

TFT and WiFi conflict on ESP32 UWB #3558

SelyaRFP opened this issue Nov 20, 2024 · 0 comments

Comments

@SelyaRFP
Copy link

SelyaRFP commented Nov 20, 2024

When running the code below, I get a white screen after initializing WiFi. status()
I'm using Arduino IDE (v2.1.2), ESP32 UWB (datasheet) and a TFT screen 3.2" 320 x 240 ILI9341 with the TFT_eSPI v2.5.43 library.

Here my UserSetup.h

// See SetupX_Template.h for all options available
//#define USER_SETUP_ID 1

#define ILI9341_DRIVER
#define TFT_MOSI 23
#define TFT_MISO 19
#define TFT_SCLK 18
#define TOUCH_CS 21
#define TFT_CS   15//5  // Chip select control pin D8
#define TFT_DC   12//2//21  // Data Command control pin
#define TFT_RST  4//-1  // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST  -1    // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V


#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_GFXFF  // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts


#define SMOOTH_FONT


// #define SPI_FREQUENCY  27000000
#define SPI_FREQUENCY  40000000
// #define SPI_FREQUENCY  80000000

#define SPI_READ_FREQUENCY  20000000

#define SPI_TOUCH_FREQUENCY  2500000


// #define SUPPORT_TRANSACTIONS

And here my test code

#include <SPI.h>
#include <TFT_eSPI.h>
#include <WiFi.h>

TFT_eSPI tft = TFT_eSPI();

const char* ssid = "my_ssid";
const char* password = "my_password";

void setup() {
  Serial.begin(115200);
  delay(10);
  Serial.println('\n');

  Serial.print("Before tft.init()");
  delay(1000);

  tft.init();
  tft.setRotation(1);
  tft.fillScreen(TFT_BLACK);
  tft.setTextFont(2);
  tft.setTextSize(1);
  tft.setCursor(10, 10);

  tft.println("Welcome!");  // <<-- I see on my screen
  delay(1000);

  Serial.print("Before WiFi.begin()");
  delay(1000);

  WiFi.begin(ssid, password); // <<-- I still see welcome message
  delay(1000);
  while(WiFi.status() != WL_CONNECTED) {  // <<-- Now i see white screen
    delay(500);
    Serial.print('.');
  }

  Serial.print("After WiFi.begin()");
  delay(1000);

  tft.println("Welcome again!");  // <<-- Nothing happens, i still see white screen
  delay(1000);
}

void loop() {

}

I tried initializing WiFi first, then using tft screen. But I need to get WiFi data and output it to the TFT screen.
Please check that my "UserSetup.h" settings and ESP32 UWB (datasheet) match.

I also tried use 3.3V and 5V connections for VCC and LED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant