Page 1 of 1

Use GPIO12, 13, 14, 15 as "normal" IOs

Posted: Tue Apr 23, 2019 7:13 am
by lizard.king
Hi

I known that the ESP32 uses the GPIOs12, 13, 14, 15 for JTAG and that it is possible to configure them as "normal" IOs (mainly as outputs), but no matter what I try I dont succed reconfiguring those pins.

I have tried to use the methods below (for pin 14), but also other hints I found on the web. Unfortunately they all didnt work for me. The led connected to port 14 just flickers a bit (not only during bot as expected), but I cant turn it on and of in a controlled fashion. Btw, apart from the problems with those special pins my code works as expected.

Not working gpio_config

Code: Select all

gpio_config_t config;
config.pin_bit_mask = (1 << 14);
config.mode = GPIO_MODE_INPUT_OUTPUT; 
config.pull_up_en = GPIO_PULLUP_ENABLE;
config.pull_down_en = GPIO_PULLDOWN_DISABLE;
config.intr_type = GPIO_INTR_DISABLE;
gpio_config(&config);

pinMode(14, OUTPUT);
Not working PIN_FUNC_SELECT

Code: Select all

PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[14], PIN_FUNC_GPIO);

pinMode(14, OUTPUT);
What am I doing wrong?
I'd be grateful if someone could post a working arduino example how to use those pins as "normal" GPIOs.

Thanks for your help.

Re: Use GPIO12, 13, 14, 15 as "normal" IOs

Posted: Tue Apr 23, 2019 11:51 am
by username

Re: Use GPIO12, 13, 14, 15 as "normal" IOs

Posted: Tue Apr 23, 2019 11:56 am
by lizard.king
OK, found the problem. A mistake at my end.

I had connected the led to the cmd pin instead of GND (that small writing on the board is hard to read). It is no surprise that the led was flickering.