How to flash firmware on ESP8266
Working with ESP8266 Wi-Fi module? Well, the first and the most important thing to know is how to flash firmware on the ESP8266.
In this post we will explore how to connect the ESP8266 to power supplies and the PC before starting the flash process.
Please note that the ESP works on 3.3 volts. Do not connect it to a 5v supply.
- USB to TTL converter (we will use the CP2102 module)
- ESP8266 – The most obvious requirement
- Bi-directional logic level converter
- 3.3v supply
- A push-to-ON button
The steps involved in flashing the ESP are very simple and straight forward.
Putting the ESP8266 into flash mode
To put the ESP8266 into flash mode, we need to pull the GPIO0 pin to ground. Along with that, we also need to connect the ESP8266 to power supply. Whenever we connect GPIO0 pin to ground, the ESP8266 enters flash mode. Make sure to remove the ESP from flash mode once the flashing is done.
The three steps are:
- Connect the VCC pin to 3.3v supply
- Connect the GND pin to the supply’s ground
- Connect the GPIO0 pin to ground.
Connect the ESP with the USB to TTL converter
We now have to connect the Rx and Tx pins from the USB to TTL converter to the ESP8266. This is the only tricky part in this whole process.
Since the USB to TTL converter works on 5v whereas the ESP8266 works on 3.3v, we can’t interface the two of them directly. Hence, we have to convert the 5v signal to 3.3v and 3.3v to 5v.
The saviour – The bi-directional logic level converter
We can easily do this using a network of resistors. But there are some serious problems with that method.
A detailed discussion on the working of this module can be found in this post – Working of the Bi-Directional Logic Level Converter. For now, lets see how to use this as a medium to interface the USB to TTL converter and the ESP.
The Connections diagram
Make all the connections as shown in the image below
Once this is done, we are good to go. Since there are different types of firmware available, we will discuss them in posts dedicated to each. As of now, I will do the following firmwares:
The connections for every firmware remains the same. There is no need to make any change for a particular firmware.
Other posts by Vivek