-->
Page 1 of 2

Information about ESP8266 GPIOs and communication

PostPosted: Wed Sep 02, 2015 5:55 am
by Yaro
Hi all,

I've looked on web and didn't find anything usefull to explain ESP8266 GPIO_0 and GPIO_2 uses. Can someone explain me better?

Also, since ESP8266 use UART communication and no GPIOs as I can see on applications. How it's possible to have notifications for incoming RX trasmission? For example WIFI modules have a GPIO int. pin that advise host MCU about incoming data, how this works on ESP8266, there is something similar or should I always monitor UART incoming data?

Re: Information about ESP8266 GPIOs and communication

PostPosted: Wed Sep 02, 2015 8:05 am
by martinayotte
GPIO15/GPIO2/GPIO0 are used to indicate MCU which mode to boot :

https://github.com/esp8266/esp8266-wiki ... ot-Process

But after the boot process is finish, it can be use as normal GPIOs.

For UART, what is your question exactly ? because there are status register to figure out if character has come in from RX. There are possibilities to handle that thru interrupts.

Re: Information about ESP8266 GPIOs and communication

PostPosted: Wed Sep 02, 2015 10:14 am
by Yaro
But in most application GPIO are left floating, this mean that there is a default mode?

Can you indicate me where to find or how to set a GPIO from ESP as interrupt?

Re: Information about ESP8266 GPIOs and communication

PostPosted: Wed Sep 02, 2015 10:42 am
by martinayotte
Leaving pin floating is not a good practice, there were some debates on that.
In general, a good practice is to use external pullups to avoid any ESD triggering the pins.
Many people faced unwanted reset on ESP because they didn't add pullups on RES pin, same thing can be apply to other pins.

For GPIO interrupts, on ArduinoESP, they are initialized with attachInterrupt(MyPin, interrupt_callback, CHANGE), where CHANGE is on both edges, it can be also FALLING or RISING.
For the plain SDK, it is done using gpio_pin_intr_state_set() and gpio_intr_handler_register(), but I don't have much details since I'm using ArduinoESP regularly.
I've found that thread, maybe it can help : viewtopic.php?f=9&t=4033&start=5