How to Wire the ESP8266-12 for Programming

By December 8, 2015ESP8266, IoT

In my last post, I discussed how to acquire the NodeMCU firmware, and then how to flash it using a serial port (or, rather, your USB port). The assumption that I was making was that people already had the ESP8266-12 module in an easy-to-work-with form, like the NodeMCU DevKit or Adafruit Huzzah. But, some of the readers only had the bare module. I was asked what it would take to ready the ESP8266-12 module itself for programming. My response follows:

ESP8266-12 Pinouts

Here are the pinouts of the -12 module:

esp826612pinout

VCC needs to be 3.3V. Logic levels for TXD and RXD should be 3.3V also – these are your serial data lines that will connect back to your PC (or Raspberry Pi, etc) for programming. To be safe, you should use something like this device as the interface between your ESP8266 module and a PC’s USB port (available from Banggood, SparkFun, Adafruit, etc):

ftdi

This FTDI-based programmer bridges the gap between your USB port and the data IO of the ESP8266. It also has on-board voltage regulation that can provide 3.3V for the ESP.

Starter Schematic for ESP8266-12

The prototyping boards (NodeMCU DevKit and Adafruit Huzzah) use momentary buttons for Reset and Flash. If you hold Flash, press and release Reset, then release Flash, the chip will remain in Flash mode until the next reset. You can also just leave GPIO0 tied to GND with a jumper during flash programming, and then remove that jumper (and perform a reset) to restore normal operation.

A starter schematic that build on this concept, as well as sets up the IO pins for correct reset operation:

starting_schematic

Note: 10k pull-up/down resistors are shown here. This is probably the maximum value that you should use, but any value between 2k and 10k will work fine (and actually, the lower the value, the better as far as noise/glitching is concerned).

The following two tabs change content below.
  • fabian

    Awesome, thanks for your help and time. It is very understandable and clear.

  • Dian Safari

    I tried flash esp 12f with uno R3, but i got messages “warning: espcomm_sync failed
    error: espcomm_open failed”. Can you help me, please?

  • Pingback: Yunshan ESP8266 250V 15A AC/DC Network WIFI Relay Module | µC eXperiment()

  • Chris Novick

    Thanks for posting this — currently designing a board for the ESP-12e and it’s always good to double check against someone else. I noticed you don’t have a capacitor between Vcc and ground — any reason? Is it just not necessary in your mind?

    Thanks

    • Jason Follas

      Hi Chuck, my intention was for this to be a simple schematic to show the “important” IO that needs to be implemented (i.e., pull-ups and pull-downs needed by reset logic). As you pointed out, a complete schematic would also include decoupling capacitors to help reduce noise.