Hello Fellow users,
I am trying to use the GPIO of an ESP32 in Arduino IDE.
In a previous project this form of declaring the digital IO was good with an ESP32-S2:
#define RESETPIN A19
Now with the ESP32 it is not working. I have tried the followings with no success:
#define RESETPIN A19
or
#define RESETPIN 26
or
const int RESETPIN = 11;
I can check the IOS with a scope and can't see it is working. I have reinstalled the IDE in the meantime.
Has anybody any idea?
Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE
-
- Posts: 9729
- Joined: Thu Nov 26, 2015 4:08 am
Re: Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE
Well, that code just defines a pin... what does the code that actually uses that pin look like?
Re: Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE
Well, I have investigated the issue, and it seems something is confused in the documentation or I have misunderstood something.
So, when I have chosen the pin I wanted to use, I looked on the pin layout in the datasheet of the ESP32-Wrover-E. As an example let's see the IO15 pin of the device. Scope is connected here now. Then I have opened the Arduino pin definition header found her: C:\Users\Balage\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\variants\esp32 . Here it can be seen that the IO15 is defined as A13. But when I try to program this A13 pin, no signal appears on IO15. I have realized that A10 is the corresponding definition to IO15. But this doesn't make any sense.
Then how can I identify which definition is for the physical pins? I refered to A10 to program the pin, this way: digitalWrite(A10, LOW);
So, when I have chosen the pin I wanted to use, I looked on the pin layout in the datasheet of the ESP32-Wrover-E. As an example let's see the IO15 pin of the device. Scope is connected here now. Then I have opened the Arduino pin definition header found her: C:\Users\Balage\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\variants\esp32 . Here it can be seen that the IO15 is defined as A13. But when I try to program this A13 pin, no signal appears on IO15. I have realized that A10 is the corresponding definition to IO15. But this doesn't make any sense.
Then how can I identify which definition is for the physical pins? I refered to A10 to program the pin, this way: digitalWrite(A10, LOW);
-
- Posts: 826
- Joined: Mon Jul 22, 2019 3:20 pm
Re: Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE
The variant file used corresponds to the board you choose in the board manager list of Arduino IDE. If you choose "ESP32 Dev Module", then A10 is GPIO4. On ESP32-S2, A10 is GPIO11.
The single digit ADC pins correspond to ADC device 1 (ADC1), and then double digits correspond to ADC device 2 (ADC2). You can see the pinmap at the repo front page (https://github.com/espressif/arduino-es ... ard-pinmap). ADC2_CHANNEL_0 corresponds to GPIO4, so A10 = 4.
The single digit ADC pins correspond to ADC device 1 (ADC1), and then double digits correspond to ADC device 2 (ADC2). You can see the pinmap at the repo front page (https://github.com/espressif/arduino-es ... ard-pinmap). ADC2_CHANNEL_0 corresponds to GPIO4, so A10 = 4.
Re: Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE
Then the problem is that I use wrong variant file. Where can I find the Arduino pinmap of the bare ESP32-Wrover-E? And which board should I choose at boards manager?
https://hu.mouser.com/datasheet/2/891/e ... 855913.pdf
https://hu.mouser.com/datasheet/2/891/e ... 855913.pdf
Re: Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE
In the meantime I have identified the required IOs with a scope when generated signals:
IO2 = A13
IO4 = A12
IO5 = SS
IO15 = A10
Can anybody help where it is all written?
IO2 = A13
IO4 = A12
IO5 = SS
IO15 = A10
Can anybody help where it is all written?
Re: Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE
I've meet this question these day. And I realize that the pin_Code you should assign is the GPIO_<num> that show in Data sheet, Not the pin num show in pcb.For example if the IO12 is according to GPIO12, then you should assign 12 in pinMode() API in arduino.
Who is online
Users browsing this forum: No registered users and 89 guests