ESP8266 Minimum System Module With Programmer - Part 2

by jrareas in Circuits > Arduino

908 Views, 0 Favorites, 0 Comments

ESP8266 Minimum System Module With Programmer - Part 2

Screen Shot 2021-01-19 at 9.39.45 AM.png

In the Part 1 of this tutorial we went through the process of creating a PCB to hold a ESP8266-E/F module and we also created a PCB with the minimum system to get the module in the normal operation. That is not very useful without the ability to upload your code as needed and do different tests using the same development devices.

For that part, we will lear now to implement a circuit that will put the ESP8266 in upload mode and we will use a FTDI to interface your IDE with the device to upload your code.

Supplies

For this, we will need:

- The bare bone PCB designed on the Part 1

- Minimum system PCB shield from Part 1

- A FTDI device

- 2 NPN transistor or a chip like UMH3 dual NPN transistor

- 1 uF capacitor (Optional)

The Programming Circuit

bmp_96_000.bmp
Screen Shot 2021-01-09 at 9.39.13 PM.png
Screen Shot 2021-01-19 at 9.32.43 AM.png

The programming circuit is rather simple. When you press the Upload button in the IDE, the IDE will send a command to the programming interface to request the device to be in the programming mode. The interface, in our case a FTDI, will reset the module sending RESET to LOW while keeping GPIO0 HIGH. Then, when the RESET is back to HIGH, GPIO0 goes to LOW and the upload starts.

this sequence can be observed in the oscilloscope as per image in this section. The yellow line is the RESET and the blue line is GPIO0. FTDI modules have 2 pins to manage those states and combining with a pair of transistors we can accomplish that sequence without having to manually press a flash button.

When designing the minimum circuit PCB in the step 2 for Part 1 of this tutorial, you may have observed that we exposed some pins for programming. We have there the following pins:

- GPIO0 - Flash pin

- RST - reset pin

- TX - Transmission line

- RX - receiver line

- GND - ground pin

- VCC - power pin. Remember ESP8266 is a 3.3 V device

Looking at the schematic for the programming, we will need to have a pair of transistors to handle the state of the pins according to the signals from DTR and RTS pins of the FTDI.

Combining Everything Now

Screen Shot 2021-01-19 at 9.39.45 AM.png

Now we can connect everything together and test it. As you can see in the image, we have all in the breadboard. The bare ESP8266 module is soldered in a etched board. Which can be a solution if you dont want to send it to a vendor. Although a bit of work and some safety aspects you need to take into consideration, this process is very simple and I have done several boards doing this method. It is a very good way to make sure your schematic is working as it will create a board exactly for what is in the schematic. Which may not be true when doing in the breadboard.

The breadboard has the minimum system in it which will allow the ESP8266 come from the upload mode to the normal operation without any manual intervention aside from pressing the Upload button in the IDE.

The UMH3 ic is used to connect together the FTDI and the ESP8266 to manage states of GPIO0 and RST according with signals sent by RTS and DTR from the FTDI

I put together a small video showing the whole thing working. The code uploaded is a blink sketch. I am using eclipse with platformio(I will put a doc together on that later on). The video shows the upload and

Conclusion

Screen Shot 2021-01-09 at 10.02.56 PM.png
Screen Shot 2021-01-09 at 9.39.13 PM.png

This process is very useful if you want to take your projects to another level. As I like the say, NodeMCU is a development board. It is very useful for uploading code and testing your project. But, once you have everything set, you dont need all the bells and whistles that comes with it. Although you can buy one for less than U$5, it is still expensive for a final product. Not mentioning the size

With this method, you can start from a minimum system and design a custom PCB for your project with only the components required by it to operate.

Follow below github links for the designs needed to accomplish what is needed for this tutorial. Kicad files

https://github.com/jrareas/esp8266_minimum_system

https://github.com/jrareas/esp8266_programming

https://github.com/jrareas/esp8266_breakboard