ESP32S3 Unable to set specific GPIO as outputs
Posted: 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:
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:
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
has been unsuccessful.
I use GPIOS:
- 2 - Output
- 4 - No output
- 5 - No output
- 8 - Output
- 9 - Output
- 18 - No output
- 37 - Output
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:
Code: Untitled.cpp Select all
// Directly setting as an output
gpio_pad_select_gpio(pins[i]);
// Enabling as an input first, then setting as an output using the below methods:
gpio_pad_input_enable(pins[i]);
// Force set the pin function as a GPIO, attach as an output
pinMatrixOutAttach(pins[i], PIN_FUNC_GPIO, 1, 1);
// Set pins as outputs using the gpio matrix
gpio_matrix_out(pins[i], 0, 0, 0);
// Setting pin function to 0 (also combinations of the accepted signals as per the library code)
pinMatrixOutAttach(pins[i], 0, 0, 0);
// Use the inbuilt Arduino function
pinMode(pins[i], OUTPUT);
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);