-->
Page 1 of 3

use maximum GPIOs / activate Dx-Pins as GPIO(Output)

PostPosted: Fri Jul 17, 2015 2:25 am
by derpunkt
Hi,

i successfully use the ESP-201 to switch a 2-channel-relay board via wifi and even work as a client to update some webdata at the same time.

Now i wanted to switch more relays.

I found pictures shown that there are GPIO07 - GPIO10 available on the Pins D0 - D3 (for example).

I work with the Arduino IDE - but i don't get it to work that i can use these Dx-Pins to work as GPIOs (Output).

I tried with the pinMode-command - but no success.
Even the GPIO0 i do not get to work successfully.

Do you have any hints how i can get these Pins to work as GPIO?

thanks in advance...

Re: use maximum GPIOs / activate Dx-Pins as GPIO(Output)

PostPosted: Fri Jul 17, 2015 11:36 am
by martinayotte
You need to switch the function of the pin to make it as a GPIO.
If I'm not doing mistake, taken from defines in eagle_soc.h, it should look something like :
Code: Select allPIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U, FUNC_GPIO1);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0RXD_U, FUNC_GPIO3);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0);

Re: use maximum GPIOs / activate Dx-Pins as GPIO(Output)

PostPosted: Fri Jul 17, 2015 11:06 pm
by Duane J
Oh wow, this is excellent info. Thanks martinayotte. So to answer OP's question, enabling GPIOs 7 thru 10 should be possible with this, right?

Code: Select allPIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA0_U, FUNC_GPIO7);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA1_U, FUNC_GPIO8);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA2_U, FUNC_GPIO9);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA3_U, FUNC_GPIO10);

Re: use maximum GPIOs / activate Dx-Pins as GPIO(Output)

PostPosted: Sat Jul 18, 2015 8:25 am
by martinayotte
Yes, exactly !
But it is also easy to have more GPIOs using expander such MCP23017 ... ;)