-->
Page 1 of 1

Ignore GPIO2 at reboot?

PostPosted: Fri Feb 26, 2016 4:03 am
by papadeltasierra
Why? Because I'm using an ESP8266-01, want to use GPIO2 for input, always boot from the flashed ROM never from elsewhere, and I can't guarentee the input value for GPIO2.

So any way to do this? Is there either a boot rom (is that the term that the ESP8266 community uses?) that ignores GPIO2 or some cunning way to either patch or set some flash memory to cause GPIO to be ignored?

Re: Ignore GPIO2 at reboot?

PostPosted: Fri Feb 26, 2016 6:25 am
by Barnabybear
Hi, not that I know of. You can use Rx (GPIO3) as an input and still keep Tx (GPIO1) for debuging.
Code: Select all//pinMode(pin, FUNCTION_number from table)
pinMode(3, FUNCTION_3);

Sets as a GPIO then can be used as normal, it becomes GPIO 3.
Table of functions can be found here wiki/doku.php?id=esp8266_gpio_pin_allocations

Re: Ignore GPIO2 at reboot?

PostPosted: Fri Feb 26, 2016 9:13 am
by martinayotte
Since ESP-01 is really limited in term of pins count, you don't have much chance :
Either you use GPIO0/GPIO2 as input but you must warranty that they are both HIGH during boot or,
strongly suggested, use those both pins as I2C bus with pullups and add an I2C GPIO expander such PCF8574 or MCP23017.

Re: Ignore GPIO2 at reboot?

PostPosted: Sat Feb 27, 2016 10:15 am
by papadeltasierra
Barnabybear wrote:Hi, not that I know of. You can use Rx (GPIO3) as an input and still keep Tx (GPIO1) for debuging.
Code: Select all//pinMode(pin, FUNCTION_number from table)
pinMode(3, FUNCTION_3);

Sets as a GPIO then can be used as normal, it becomes GPIO 3.
Table of functions can be found here wiki/doku.php?id=esp8266_gpio_pin_allocations

Thanks for that. This is not my preferred option but I came to the same conclusion. Interesting side note but it seems that GPIO2 always pulls-high, even if I try to disable it. I theoretically (using wire to ground/resistor+VCC trigger) got interrupts working but the receiver that I was connecting to GPIO2 won't trigger them because it cannot pull GPIO2 down. Hopefully I won't have the same problem with Rx/GPIO3.