ESP32S3 Unable to set specific GPIO as outputs

phalpin9
Posts: 2
Joined: Mon Mar 18, 2024 9:47 am

ESP32S3 Unable to set specific GPIO as outputs

Postby phalpin9 » Mon Mar 18, 2024 11:28 am

I've designed a custom ESP32S3 board for controlling some motors. In testing my GPIO, I've found that I can't set some of my GPIO as outputs.

I use GPIOS:
  • 2 - Output
  • 4 - No output
  • 5 - No output
  • 8 - Output
  • 9 - Output
  • 18 - No output
  • 37 - Output
(I have some others that I plan to use, but they tie directly into motor drivers etc, and as I'm still testing I haven't gotten that far yet.)

The above GPIO are tied directly to pin headers, so there isn't some intermediate circuitry holding them out.

I've tried the below functions to try "force" an output:
  1. // Directly setting as an output
  2. gpio_pad_select_gpio(pins[i]);
  3. // Enabling as an input first, then setting as an output using the below methods:
  4. gpio_pad_input_enable(pins[i]);
  5. // Force set the pin function as a GPIO, attach as an output
  6. pinMatrixOutAttach(pins[i], PIN_FUNC_GPIO, 1, 1);
  7. // Set pins as outputs using the gpio matrix
  8. gpio_matrix_out(pins[i], 0, 0, 0);
  9. // Setting pin function to 0 (also combinations of the accepted signals as per the library code)
  10. pinMatrixOutAttach(pins[i], 0, 0, 0);
  11. // Use the inbuilt Arduino function
  12. pinMode(pins[i], OUTPUT);
For the pins that worked originally, I had mixed results using the above more low level functions. I also found that you can digitalRead a pin back in to check the output state, which I found to be accurate when I confirmed with a multimeter.

Has anyone else seen this issue? Is there anything else I can try? Even the simplest

Code: Select all

pinMode(18, OUTPUT);
digitalWrite(18, HIGH); 
has been unsuccessful.

liaifat85
Posts: 137
Joined: Wed Dec 06, 2023 2:46 pm

Re: ESP32S3 Unable to set specific GPIO as outputs

Postby liaifat85 » Mon Mar 18, 2024 3:46 pm

What output are you getting? Is there any error message?

lbernstone
Posts: 673
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32S3 Unable to set specific GPIO as outputs

Postby lbernstone » Mon Mar 18, 2024 7:10 pm

If you aren't seeing the pin voltage go to 3v3 with a simple digitalWrite, then you have a hardware issue. Disconnect everything, plug the esp32 directly into a good bench 3v3 source, and verify that it works. These sorts of odd behaviors very often are caused by low current or high voltage power supplies. You can also get power issues by having too much current draw from external devices. The maximum any pin can supply is 40mA (but to be conservative say 20mA), and the total should be <150mA for all devices (note that at 150mA your soc will get VERY hot). Anything over 20mA really should be switched through a transistor/mosfet.

phalpin9
Posts: 2
Joined: Mon Mar 18, 2024 9:47 am

Re: ESP32S3 Unable to set specific GPIO as outputs

Postby phalpin9 » Mon Mar 25, 2024 9:21 am

Hi @liaifat85, no errors, just no voltage.

Hi @lbernstone, I've got a 3V3 regulator rated for over 2A output, with a 7.4V Li-Ion battery. Should be good power supply-wise. I see the issue even when trying to drive pins on their own. I do have MOSFETs/BJTs in line to drive outputs, but I've even checked at the input to these and no bueno.

By the sounds of it, I may need to resolder down my IC as I might have an airgap underneath, though all the solder joints along each edge seemed to be solid.

I'll report back if it's my assembly ability or if I continue to have issues.

lbernstone
Posts: 673
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32S3 Unable to set specific GPIO as outputs

Postby lbernstone » Wed Mar 27, 2024 10:16 pm

I've forgotten to put paste under the ground pad entirely before. That is probably a bit more obvious than a couple missed pins :)

liaifat85
Posts: 137
Joined: Wed Dec 06, 2023 2:46 pm

Re: ESP32S3 Unable to set specific GPIO as outputs

Postby liaifat85 » Tue Apr 02, 2024 11:14 am

lbernstone wrote:
Wed Mar 27, 2024 10:16 pm
I've forgotten to put paste under the ground pad entirely before. That is probably a bit more obvious than a couple missed pins :)
So, the problem solved after putting paste properly?

lbernstone
Posts: 673
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32S3 Unable to set specific GPIO as outputs

Postby lbernstone » Tue Apr 02, 2024 5:28 pm

liaifat85 wrote:
Tue Apr 02, 2024 11:14 am
lbernstone wrote:
Wed Mar 27, 2024 10:16 pm
I've forgotten to put paste under the ground pad entirely before. That is probably a bit more obvious than a couple missed pins :)
So, the problem solved after putting paste properly?
The ground pad is underneath on a module. The fix is to desolder the module and reset it with the proper paste.

User avatar
jgustavoam
Posts: 134
Joined: Thu Feb 01, 2018 2:43 pm
Location: Belo Horizonte , Brazil
Contact:

Re: ESP32S3 Unable to set specific GPIO as outputs

Postby jgustavoam » Fri Apr 05, 2024 2:17 am

What is the ESP32 S3 module model? Caution! May be inappropriate use of GPIO37.

ESP32S3 GPIO restrictions :

Strapping pin: GPIO0, GPIO3, GPIO45 and GPIO46 are strapping pins.

SPI0/1: GPIO26-32 are usually used for SPI flash and PSRAM and not recommended for other uses. When using Octal Flash or Octal PSRAM or both, GPIO33~37 are connected to SPIIO4 ~ SPIIO7 and SPIDQS. Therefore on ESP32-S3R8 / ESP32-S3R8V board GPIO33~37 are also not recommended for other uses.

USB-JTAG: GPIO 19 and 20 are used by USB-JTAG by default. In order to use them as GPIOs, USB-JTAG will be disabled by the drivers.

Reference:
https://docs.espressif.com/projects/esp ... /gpio.html
Retired IBM Brasil
Electronic hobbyist since 1976.

RandomInternetGuy
Posts: 28
Joined: Fri Aug 11, 2023 4:56 am

Re: ESP32S3 Unable to set specific GPIO as outputs

Postby RandomInternetGuy » Thu Apr 18, 2024 9:14 pm

A useful community resource (including open issues, discussion) on this topic can be found at
https://github.com/atomic14/esp32-s3-pinouts

Who is online

Users browsing this forum: Baidu [Spider], Basalt and 139 guests