Input I/O Stuck Low on TTGO T-Display-S3 module

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

Input I/O Stuck Low on TTGO T-Display-S3 module

Postby Ericesp32 » Thu Jun 06, 2024 3:45 am

I have 2 TTGO T-Display-S3 boards. I've been working with them for a while, one is unused and brand new.

I'm running the Arduino platform with VS Code.

I have a single input pin for a button but lately it has gotten sporadic and seems to be stuck low according to digitalRead but both my DMM and analog sampling of the pins show it high. I can toggle it with the button and it moves from high to low (DMM and analog samples) however the digitalRead thinks it's still 0.

I tried switching input pins on the development board but I keep getting similar results. I also tried running the code on the brand new board and keep getting the same thing. It's very strange because it's been working fine for a while, but I noticed if the device sat for hours it would start to think the button was stuck low. Now it appears to think the button is always low (even with nothing connected).

I've tried a 10k pullup. I've tried switching the input type back and forth with INPUT_PULLUP or just INPUT. I've tried this on the brand new board and found similar behavior, but it seems to be stuck all the time now. It used to seem to drift high and low, or work as expected. But now it's stuck low.

Normally I would just replace the hardware, but I've gone through 4 of these (2 of them had issues with the I2C bus not working) and now this problem.

Doesn't anyone have any thoughts on this or heard of similar issues with this board?

Here's my test code, I've stripped it down just to look at this issue.

Code: Select all

#include <Arduino.h>
#include <SPI.h>
#include <FS.h>
#include <SPIFFS.h>

#define BUTTON_PIN 14

void setup()
{
  // setup serial
  Serial.begin(115200);
  Serial.println();

  // setup input/output
  pinMode(BUTTON_PIN, INPUT_PULLUP);

}

void loop()
{
  // Read the value from the input pin
  int pinValue = digitalRead(BUTTON_PIN);

  // Print the value to the Serial Monitor
  Serial.print("The value of the input pin ");
  Serial.print(BUTTON_PIN);
  Serial.print(" is: ");
  Serial.println(pinValue);

  // Measure and print the actual voltage at the input pin
  int analogValue = analogRead(BUTTON_PIN);
  float voltage = analogValue * (3.3 / 4095.0);
  Serial.print("Voltage at input pin: ");
  Serial.println(voltage);

  // Add a delay to avoid flooding the Serial Monitor
  delay(1000);  
}
Typical output:
The value of the input pin 14 is: 0
Voltage at input pin: 3.30
The value of the input pin 14 is: 0
Voltage at input pin: 3.30
The value of the input pin 14 is: 0
Voltage at input pin: 3.30
The value of the input pin 14 is: 0
Voltage at input pin: 3.30

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

Re: Input I/O Stuck Low on TTGO T-Display-S3 module

Postby Ericesp32 » Wed Jun 12, 2024 3:08 am

I am at my wits end here with this T-Display-S3. The only I/O pins I can get to work reliably are the ones on board for GPIO0 and GPIO14. I was previously using GPIO16 in my post above, but because it goes in and out of sleep mode I thought maybe somethings not quite right with the RTC IO. I tried several things suggested in the manual but nothing changed.

So I switched to GPIO3 and put a 5k pullup on it. It sits at 0.8V when setup as input_pullup. Here's the very simple code which behaves the same on 2 different ESP32 boards.

Code: Select all

#include <Arduino.h>
#include <SPI.h>
#include <FS.h>
#include <SPIFFS.h>

int left=3;
int right=14;

void setup(void)
{    
  pinMode(left,INPUT_PULLUP);
  pinMode(right,INPUT_PULLUP);
   
  Serial.begin(115200);
  Serial.println("Ready.");
}

void getValue(int pin){
  int pinValue = digitalRead(pin);
  // Print the value to the Serial Monitor
  Serial.print("The value of the input pin ");
  Serial.print(pin);
  Serial.print(" is: ");
  Serial.println(pinValue);
}

void loop()
{
  if(digitalRead(left)==0){
    Serial.println("Left");
    getValue(left);
  }
  if(digitalRead(right)==0)
  {
      Serial.println("Right");
      getValue(right);
  }
   
  delay(100);
}
It's stuck at 0.8V and low on GPIO3 too. Any ideas of what could be going on here? The other IO pin in this example, GPIO14, is a button built into the T-Display-S3 and it always works fine and only has a 100k pullup externally. I also tried adding a little 1000pF capacitance in shunt across the button I/O but that didn't change anything either

ESP_Sprite
Posts: 9708
Joined: Thu Nov 26, 2015 4:08 am

Re: Input I/O Stuck Low on TTGO T-Display-S3 module

Postby ESP_Sprite » Thu Jun 13, 2024 12:34 am

You sure that the issue is not the button? Sometimes, crud (flux) remains in place, attracts moisture, and gets somewhat resistive.

Who is online

Users browsing this forum: No registered users and 84 guests