Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE

balage
Posts: 6
Joined: Mon Jul 06, 2020 11:21 pm

Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE

Postby balage » Sun Aug 02, 2020 11:36 am

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?

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

Re: Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE

Postby ESP_Sprite » Sun Aug 02, 2020 1:46 pm

Well, that code just defines a pin... what does the code that actually uses that pin look like?

balage
Posts: 6
Joined: Mon Jul 06, 2020 11:21 pm

Re: Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE

Postby balage » Sat Aug 29, 2020 10:11 pm

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.
pin.JPG
pin.JPG (93.91 KiB) Viewed 6062 times
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.
pinAruino.JPG
pinAruino.JPG (46.49 KiB) Viewed 6062 times
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);

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

Re: Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE

Postby lbernstone » Sat Aug 29, 2020 11:35 pm

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.

balage
Posts: 6
Joined: Mon Jul 06, 2020 11:21 pm

Re: Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE

Postby balage » Sun Aug 30, 2020 7:31 am

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

balage
Posts: 6
Joined: Mon Jul 06, 2020 11:21 pm

Re: Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE

Postby balage » Mon Aug 31, 2020 2:36 pm

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?

lzd1230
Posts: 1
Joined: Sun Oct 23, 2022 9:16 am

Re: Can't use digital GPIO of ESP32-Wrover-E2 from Arduino IDE

Postby lzd1230 » Sun Oct 23, 2022 9:21 am

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