Blog Detail

Programmer / Serial Interface for ESP8266 and ESP32

12 Feb 21
No Comments

On the Market you can find an incredible amount of boards with ESP chips on them made for Makers.

Using those boards in a Dev environment is easy because you can simply plug them into your breadboard and use the on board USB to directly program them via Arduino or PlatformIO.

When you leave the Breadboard Area and start projects where the ESPs are built into some case and you intend to reprogram the ESPs while in the case, it is very hards to design the case in a way so you can reach the USB of the ESP Board.

So I intended to split the functionality of programming and the actual ESP processor into 2 boads. Programming shall be easy to build into a case and the ESP also shall be able to end up wherever suitable in the case.

I had a look at the various USB to TTL solutions on the marked and did not find a single one fitting my needs because they ALL lack the necessary UART pins.

How to program a ESP?

Basically it is very simple: Pull the GPIO0 to LOW and reset the chip via a short Low on the Reset (EN) pin. After that, the chip is able to be programmed via TX/RX.

How to control the GPIO0 and Reset Pins. A look into the documentation of PlatformIO, they use the UART signals RTS/DTR for that. RTS is for Reset and DTR for “Flash”.

And exactly those signals are missing in the most UART adapters.

So I  designed my ESP boards in a way to have Reset and GPIO0 pulled up to +3.3Volts, and have RTS and DTR pulling them to low in the right sequence.

This is basically what the most ESP Prototype boards do. They usually have an additional logic (2 transistors) built in there because most of them also have pushbuttons to reset or flash the ESP. In my case I do not need that, so the simple pullup solution will do.

The next question to solve was: Which USB to UART converterchip to use? The defacto standard is the FTDI232 Chip. I tried it and I got it working, but it has a lot of pins and the TSSOP package has quite minimal distances between the pins (not easy to solder by hand).

A great alternative ar the CH3X0 chips. I used CH330N for projects not requiring DTR/RTS, just RX/TX. For DTRand RTS I switched to CH340C.

I directly went for 3.3V supply to the UART since ESPs like 3.3V. The 3.3V is generated by an AMS1117 for 3.3V.

Usign KiCAD leads to the folloging PCB

Get it manufactured by JLCPCB and you end up with this PCB in your Hands.

R1 by the way is an optional Resistor to couple Ground against the shielding of the USB. The internet was not clear how to handle shielding the USB. Some connect ot to ground, others don’t




Leave A Comment