Although it’s powerful, the NodeMCU ESP8266-12 limitations can slow you down.
Recently, I have been doing a lot of work with the NodeMCU ESP8266-12E development board. As with previous ESP board versions, finding good documentation continues to be challenging. While the original ESP6266-01 module only had two GPIO (general purpose input output) pins, this latest iteration has many more. But how many more?
While the underlying Espressif chip has 17 GPIO, they are not fully exposed or available on the development board. And many of them are shared or multiplexed with other development board features. This means that they are not available for program use, or only available sometimes. In fact, this board has four different functional modes which are hidden from the user and use the pins in different ways for each mode. If you are interested, you can read about these in Neil Kolban’s wonderful book on the ESP8266.
Most hobbyists these days are programming the NodeMCU with the Arduino core library. This means programming the Espressif systems “as if” they were really just an enhanced Arduino with WiFi on board. This generally works great. And the Arduino core maps the available GPIO pins to D0..D10, as shown in the picture above.
NodeMCU ESP8266-12E Limitations Mostly Effect GPIO
Based on my reading and experimentation, here is what I have learned about NodeMCU ESP8266-12E limitations with GPIO pins.
- The basic pins for digital input and output are D0..D8. These also support Arduino style pin interrupts, except for D0, which cannot support PWM either.
- D9 and D10, also labeled RX and TX on some boards, are also used for serial communications, including loading programs onto the device. I have read that if your program does not use serial communications, you can also use D9 and D10 as digital I/O. But, I have not been able to get this to work reliably.
- If you are using hardware Serial Peripheral Interface Bus (SPI) to communicate with peripherals, pins D5..D8 become unavailable, as they are used for hardware SPI. For example if you are using SPI with two peripherals, you tie up 8 pins: D5..D8 for the bus, two more pins for select, and two more pins for control.
- Some experimenters say that they have used GPIO9 and GPIO10 for input and output, respectively. But, not me.
- Also, remember that certain GPIO (0, 2 15) must be in specific states during boot and flash. Another limitation if you are not careful.