I’m currently using an ESP32-S3 16mb, 2x 2.8” LCD screens via SPI, 1x 74LS04, SD Card reader, speaker and keypad. Currently the SD Card reader is not connected to power.
When I connect power to my ESP32-S3, it will no longer initialize the screens on its own… unless I connect the usb-c. The setup I’m using is a breadboard power supply, capable of supplying 1A to the circuit. I have the +5v rail of the breadboard connected to the Vin on the ESP32, the 2 screens and the 7404.
When my code was 2500-ish lines and only 150,000 lines in header files (mostly graphics), I had no problems. Turn on the power supply, ESP32 boots and initializes the screens and runs the program no issues. The ESP32 has an onboard green LED that blinks 5 times during boot.
My program currently is about 3500+ lines of code w/ about 250,000 lines in header files (mostly graphics). Now when I turn on the power, the ESP32 still does the 5 blinks on the green LED and boots, but will not initialize the 2 screens. The screens just stay blank white. I know the program is running because the speaker plays a tone when certain keypad buttons are pressed. Sometimes, after pressing the reset several times, it will boot and initialize the screens. But, if I have the USB-c cord plugged in, either to my pc or a USB power supply, it will boot and initialize the screens w/o issue.
I’ve metered the power draw on the circuit and it draws no more that 160mA when booting/running. I’ve tried a delayed reset w/ the 7404 in combination w/ an RC circuit. I’ve tried to delay the initialization of the screens in the code. I’ve tried putting delays in the screen init function. I’ve tried a different ESP32 module. I’ve even gone back several revisions of my program, when the code was about 2500 lines and that old code works w/o having the USB plugged in. Nothing in the screen init functions/code has change from any of the revisions.
Since I can’t actually see the failure via the serial monitor, because with the USB plugged in it works, I can’t tell if the screens just fail to initialize or if it’s the ESP32 or a power problem. Could it be that the increased code/graphics is drawing more power? Wouldn’t think so, since the memory is still there, just not filled. But, what do I know? I guess I could wire an LED light to a spare pin and light it when the screens init…
Does anyone have any suggestions?
Thank you in advance
// LCD Display control signals using Hardware SPI
#define TFT_S1_CS_PIN 14 // Screen 1 Chip Select
#define TFT_S2_CS_PIN 8 // Screen 2 Chip Select
TFT_eSPI tft = TFT_eSPI(); // Create instance for TFT Screen(s) -> 1 instance for 2 screens w/ soft /CS
void Initialize_Screens(void) {
pinMode(TFT_S1_CS_PIN, OUTPUT); // Screen 1 chip select set to output
pinMode(TFT_S2_CS_PIN, OUTPUT); // Screen 2 chip select set to output
delay(10); // Let settle
digitalWrite(TFT_S1_CS_PIN, HIGH); // Initial /CS setting
digitalWrite(TFT_S2_CS_PIN, HIGH); // Initial /CS setting
digitalWrite(TFT_S1_CS_PIN, LOW); // Select Screen 1
digitalWrite(TFT_S2_CS_PIN, LOW); // Select Screen 2
Serial.print("Initalizing Both LCDs... ");
delay(25); // Give time for /CS setup
tft.init(); // Initialize Screen(s)
digitalWrite(TFT_S2_CS_PIN, HIGH); // De-Select Screen 2
tft.setRotation(1); // Set rotation of screen 1
tft.fillScreen(TFT_BLACK); // Clear screen
digitalWrite(TFT_S1_CS_PIN, HIGH); // De-Select Screen 1
digitalWrite(TFT_S2_CS_PIN, LOW); // Select Screen 2
delay(25); // Give time for screen setup
tft.setRotation(1); // Rotate
tft.fillScreen(TFT_BLACK); // Set rotation of screen 2
digitalWrite(TFT_S2_CS_PIN, HIGH); // De-Select Screen 2
delay(10);
dblbuffer.createSprite(DOUBLEBUFFER_X, DOUBLEBUFFER_Y); // Set sprite dimensions
tft.setTextSize(1);
tft.setTextColor(TFT_BLACK);
Serial.println("done");
}