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

lizard.king
Posts: 2
Joined: Tue Apr 23, 2019 6:51 am

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

Postby lizard.king » Tue Apr 23, 2019 7:13 am

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.


lizard.king
Posts: 2
Joined: Tue Apr 23, 2019 6:51 am

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

Postby lizard.king » Tue Apr 23, 2019 11:56 am

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.

Who is online

Users browsing this forum: No registered users and 15 guests