How to configure all gpio as input and output in esp32

amalamal
Posts: 23
Joined: Mon Dec 12, 2016 7:07 am

How to configure all gpio as input and output in esp32

Postby amalamal » Wed Jan 11, 2017 6:40 am

Hi

i am trying to make all gpio are input and output in esp32 with eclipse IDE, GPIO 2,0,4,16,17,5,19,18,21,22,23,25,26,27 i can configure now, anyone please tell me how to use multiplexed pins as gpio only.


Thanks

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: How to configure all gpio as input and output in esp32

Postby kolban » Wed Jan 11, 2017 2:27 pm

Howdy amalamal,
To the best of my knowledge, calling gpio_pad_select_gpio() on any of the pins 0-39 makes them GPIOs. However, please realize that pins 34-39 can be used as input only while all the other pins can be used as input or output. Also note that the pins 20, 24, 28, 29, 30 and 31 are not exposed so there are a maximum of 34 pins available to us.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

amalamal
Posts: 23
Joined: Mon Dec 12, 2016 7:07 am

Re: How to configure all gpio as input and output in esp32

Postby amalamal » Sat Jan 21, 2017 6:01 am

Hi Sir

Thanks for the suggestion, i tried like that with " gpio_pad_select_gpio()" function, except GPIO 32,33,6,7,8,11 are working, I tried of making those pins as input, the system is rebooting continuously, i am attaching my code, please find attachment.
Attachments
Make gpio as input_esp32.c.tar.gz
(1.04 KiB) Downloaded 1658 times

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: How to configure all gpio as input and output in esp32

Postby WiFive » Sat Jan 21, 2017 7:20 am

Gpio 6-11 used by flash chip

Gpio 32-33: https://github.com/espressif/esp-idf/issues/143

amalamal
Posts: 23
Joined: Mon Dec 12, 2016 7:07 am

Re: How to configure all gpio as input and output in esp32

Postby amalamal » Sat Jan 21, 2017 12:00 pm

Hi WiFive

As GPIO 6-11 is connected with flash , so can i use those pins as normal gpio or not ?
We are planning one application with esp32 which needs more gpios , so i need to confirm whether esp32 is suitable for it. Could you please confirm the status about gpio 6-11.



Thanks
Amal

User avatar
martinayotte
Posts: 141
Joined: Fri Nov 13, 2015 4:27 pm

Re: How to configure all gpio as input and output in esp32

Postby martinayotte » Sat Jan 21, 2017 3:38 pm

amalamal wrote: As GPIO 6-11 is connected with flash , so can i use those pins as normal gpio or not ?
No ! How the ESP would run without having access to the flash ...
If you need more GPIOs, why not use an I2C GPIO Expander, such MCP23017 ?

amalamal
Posts: 23
Joined: Mon Dec 12, 2016 7:07 am

Re: How to configure all gpio as input and output in esp32

Postby amalamal » Mon Jan 23, 2017 6:04 am

Thanks for your replay sir,

Now i am planning to connect an external flash in the same lines of internal flash(SD0,SD1,SD2,SD3,CLK) with another chip select, is it possible?
If it is possible , how i can disable the chip chip select pin of internal flash so i could enable my external flash and do read and write data.


Thanks
Amal

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

Re: How to configure all gpio as input and output in esp32

Postby ESP_Sprite » Mon Jan 23, 2017 8:58 am

At the moment, using the esp-idf drivers, you cannot use the lines for the internal SPI flash for anything else yet. We have plans to change this in the future, but we're not there yet.

Who is online

Users browsing this forum: No registered users and 128 guests