Problems with ESP32 input pins on T-display-s3 module

Ericesp32
Posts: 5
Joined: Thu Jun 06, 2024 3:00 am

Problems with ESP32 input pins on T-display-s3 module

Postby Ericesp32 » Wed Sep 04, 2024 8:48 pm

This problem has been driving me crazy. I have several T-Display-S3 modules and I have nothing connected to gpio 1 and 16. I have verified there's very high impedance on both lines. I can drive them both high and low with out any problems (using high impedance scope probe).

However when using the arduino framework and setting one to an input with internal pullups they do not pull high and spike up randomly (not just raw noise) to 1.3V and sit at 0.7V.

I've also used 10k external pullups and found the behavior doesn't change. I'm using this test code

Code: Select all

#include <Arduino.h>

void setup()
{
  Serial.begin(115200);
  delay(1000);
  Serial.println("Running.");
  pinMode(PIN_16, OUTPUT);
  pinMode(PIN_1, INPUT_PULLUP);
}

void loop()
{
  delay(3000);
  Serial.print("Toggle 16 HIGH, 1...");
  int value = digitalRead(PIN_1);
  digitalWrite(PIN_16, HIGH);
  Serial.println(value, BIN);
  delay(3000);
  Serial.print("Toggle 16 low, 1...");
  value = digitalRead(PIN_1);
  digitalWrite(PIN_16, LOW);
  Serial.println(value, BIN);
}
with this build log
Processing lilygo-t-display-s3 (platform: espressif32; board: lilygo-t-display-s3; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards ... ay-s3.html
PLATFORM: Espressif 32 (6.8.1) > LilyGo T-Display-S3
HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20017.0 (2.0.17)
- tool-esptoolpy @ 1.40501.0 (4.5.1)
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
- toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 33 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio/build/lilygo-t-display-s3/firmware.elf
Checking size .pio/build/lilygo-t-display-s3/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 5.6% (used 18396 bytes from 327680 bytes)
Flash: [ ] 3.9% (used 253829 bytes from 6553600 bytes)
I'm really at a loss with what is happening here with the single input pins and I have been working on this for a long time. In this example I can swap the PIN1 and PIN16 to just check the right ones are being controlled and measured on my oscilloscope. The outputs behave as expected but if either one is an input, it does not pull high and has short pulses high with nothing connected.

Anyone have any ideas?

aliarifat794
Posts: 170
Joined: Sun Jun 23, 2024 6:18 pm

Re: Problems with ESP32 input pins on T-display-s3 module

Postby aliarifat794 » Thu Sep 05, 2024 8:08 am

Random voltage spikes can occur due to electrical interference or crosstalk between pins. It is more possible when if you have other signals or peripherals nearby.
Many issues in the PCB layout, such as poor grounding or trace proximity, can cause strange behaviours on pins. If it is custom hardware, please check.

Ericesp32
Posts: 5
Joined: Thu Jun 06, 2024 3:00 am

Re: Problems with ESP32 input pins on T-display-s3 module

Postby Ericesp32 » Fri Sep 06, 2024 8:22 pm

Well, I wish it was that easy. Just for some background I'm an EE with a specialty in RF, so you know where I'm coming from.

I've had some really inconsistent issues with the T-display-s3 and have been buying them directly from the manufacturer to hopefully get fully tested good quality.

However I have 2 main issues that won't go away. This I/O problem is theoretically the simplest of the 2.

With nothing connected to the I/O pins and using the INPUT_PULLUP setting the highest voltage reached is about 0.8V, even with an external pullup on the input pin. If I change the configuration to an output, it will easily go to the rails both directions (with or without an external pullup).

So it appears the I/O is functional, however in input mode something is not making sense. I've attached the schematic. With nothing loaded and running off the USB supplied power, I still experience these problems with random jumps on the input pin from 0.8V to about 1.4 to 1.6V (not narrow noisy spikes, but looks solid and will sit at the voltage momentarily).

The second problem I have, which I don't want to discuss in this thread is with the I2C bus. It often times out and resets and there seems to be some kind of silicon issue along with a history of driver issues for it. I've yet to resolve this and recommendations have been to switch to SPI like what I'm currently doing very successfully with the SD card.

Oddly the easiest thing on this project, reading the I/O state on a pin has completely stumped me. I can only think there must be something strange that I've overlooked that is somehow messing up the internal I/O block somehow, even though the URART/SPI (and occasionally I2C) works consistently fine. (at first glance it might look like the IMU Vcc is tied to a GND but that's just an unfortunate label placement). I've also verified trace by trace that my PCB matches the schematics.

A critical thing to mention here, is if I run this on the module, NOT loaded in the PCB the Input behaves as expected.
I've just been looking at this for so long, I have to assume something fundamental is wrong but I can't see it. NOTE: in these experiments, NOTHING is loaded unless it is a GND 0 ohm, like R5, R6 (for testing UART), the transistors are not loaded if if VCC is needed for testing it is just wired directly. So basically no C's, R's, Q's and all the J's are not connected to anything when testing this I/O issue.
BlN0mc09ZhY1vJag.png
schematic
BlN0mc09ZhY1vJag.png (78.04 KiB) Viewed 1712 times

MicroController
Posts: 1688
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Problems with ESP32 input pins on T-display-s3 module

Postby MicroController » Fri Sep 06, 2024 9:37 pm

A critical thing to mention here, is if I run this on the module, NOT loaded in the PCB the Input behaves as expected.
Huh.
Power supply (5V) issue maybe?
"Overloading" the module's 3V3 with external circuitry?

Ericesp32
Posts: 5
Joined: Thu Jun 06, 2024 3:00 am

Re: Problems with ESP32 input pins on T-display-s3 module

Postby Ericesp32 » Sun Sep 08, 2024 7:44 pm

Essentially nothing is loaded on the PCB except the T-Display-s3 and I've verified the traces are all as expected on the PCB. I can load everything and the SD card SPI, UART all function fine, but any I/O defined as a INPUT_PULLUP does not work.

Who is online

Users browsing this forum: No registered users and 97 guests