ESP12f auto reset problem

I am in a project where ESP12f should control some relays with a few touch buttons and via WiFi. It all works like a charm with NodeMCU or D1 mini, etc. So i tried to go from wires and make it on one board. With a NodeMCU schematics i made a design, which i intended to program with FTDI adapter with 6 pins as it has DTR and DTS. So it could be easily used with auto reset circuit. But...

What i have:
It will be a sandwich board with some other stuff under it, which are not important because all that is important for ESP12f is on the PCB which i provide schematics and design. I preloaded some sketch on ESP already so i can see what is going on. With power on, no matter with power supply under it or through headers from FTDI adapter, ESP is on and i can see massage on serial through FTDI adapter. That part is ok. But when i try to upload new sketch, it tries to connect. It says: connecting....._____.....____ etc, until it says it that board don't exist or is not connected.

Here is schematics:

And here is a design:

If needed i can take a pic of actual board.

What i tried:
I tried 10K and 12K resistors on R8 and R9 which are connected with SMD J3Y transistors (8050) with no luck. These transistors and 10K resistors are on NodeMCU board. Resistors are 1206, because i solder it by hand. :slight_smile:

What i tried else:
With a multimeter i checked what is going on while IDE try to upload sketch on transistor pads that are connected to their corresponded pads on ESP (reset, GPIO0) and saw that it changes the state just before that line on serial shows up. I double checked all connections, schematics, everything. It don't work.

Thanks in advance.

You have the ESP-12 the wrong way round! :astonished:

The antenna section of the module must be overhanging the PCB, or at the very least, over a completely blank part of the edge of the board.

I am not sure why is it not uploading sketch, BUT, i am absolutely sure that covered PCB antenna is not what cause it. Beside, NodeMCU, Wemos D1 mini, (you name it) have the same design in matter of PCB antenna position. They are all covered. I am not having connectivity issue. Preloaded sketch on ESP works just fine.

You said i made wrong way round. Can you please explain me what you point at?

Thanks in advance.

dekip:
I am not sure why is it not uploading sketch, BUT, i am absolutely sure that covered PCB antenna is not what cause it.

I didn’t suggest it was. :roll_eyes:

dekip:
Beside, NodeMCU, Wemos D1 mini, (you name it) have the same design in matter of PCB antenna position. They are all covered.

Complete rubbish!

dekip:
I am not having connectivity issue. Preloaded sketch on ESP works just fine.

You said i made wrong way round. Can you please explain me what you point at?

The squiggly part on the ESP-12 is the antenna. It must not be over any PCB trace, preferably not even over bare PCB as this will impair the effectiveness of the antenna and may even cause other problems. There is a differnce between “it works” and “it works reliably”. :astonished:

Ok, i get the point. But, rubbish or not, they work reliably.

But that is not the subject, although i will do as you advised me in my next projects.
It still isn't the reason why i can not upload sketch on ESP. Any suggestion? I checked my schematics, design few times more, but still didn't see what is wrong.

if you have the WiFi turned off then the antenna is not in play and will not effect the traces that run under it.

I cannot see the blue traces so cannot see how they run.

What bothers me most is the DRC you used. some of the traces appear to be touching corners of pads and running between pads with almost no clearance. Certainly many are closer to pads than the thickness of the trace.

as for the FTDI and the board, I did not see the interface wiring. if they are not communicating, then you get the results you stated. I would look there for the first issues.

I notice you don't have a push button on the GPIO0, so at least you can be sure to get it into program mode.

GPIO2 doesn't need an external pull-up; the internal one is enabled on boot.

You have 1206 caps on the AMS117-3.3 regulator - that suggests ceramic. That is a problem, the AMS1117 needs the higher ESR of tantalum or aluminium electrolytic capacitors to be stable.

The ESP8266 needs 100nF ceramic + 100µF or more electrolytic for decoupling placed close to the Vcc pin, that's completely missing from your schematic.

First of all, thank you all for your time.

@dave-in-nj
For antenna position, i understand your suggestion and it will be fixed in next revision. That include traces beneath. For DRC, track width and clearance are 0.2mm. In close look there is no short connection between traces and pads where they don't have to be connected. Although, they are close, but not closer then 0.2mm. FTDI adapter is working for other boards and it is ok. Here, i can see what ESP sent to serial through FTDI adapter. So, it communicate, but it doesn't upload sketch. Antenna is not turned off, sketch is WiFi scan.

Design as is, it has TX line and RESET line beside few that right now are not important, under antenna. Your suggestion is, upload is not working because of these lines? If so, i can solder auto-reset circuit on some other board and cut these on PCB, connect them and see if it works and if traces beneath antenna cause the problem. Ok?

@wvmarle
Yes, i didn't implement that button in design. My guess was that when i upload sketch, i wouldn't had to do it again in next few years, or so. Maybe way more. As i said, my design is close to one of NodeMCU, but obviously not close enough. And there, GPIO2 is pulled up with 10K. Some sources says 12K. I tried both.

Caps..
I can change caps with tantalum. Right now i only have 22uF. Could it be the issue? On most ESP8266/32 boards, there are one tantalum and one ceramic. Should i put this one? And where? 3,3V or 5V on AMS1117?

On my closer look to NodeMCU, i see that i miss 100uF on 3V3/GND, which i can add just to see if it will work.

To summarize,
i can cut traces for FTDI adapter that run under ESP and to hard-wired it with auto-reset circuit. That is ok. Next, to put 100uF capacitor next to ESP, which i have electrolytic. That is ok, too.

What next?

putting everything else aside, if I read your post right, the only problem is that the device is not recognized by the com port.

if you connect your FTDI chip to other ESP8266 12F boards and they work, then check that you have Vcc and Gnd correct, that you have the proper values on the lines and that you have the correct pins connected.
you would not be the first one to ever swap two pins on a PCB.

You can say so. But serial works.

You can see schematics and component values. Design also. I checked it multiple times before ordering PCB. But something is not right.

I uploaded sketch on ESP32 cam, few secs ago.

A prime suspect is the regulator which may end up unstable.

The combination of capacitors you see is no doubt a small (100 nF) ceramic + larger (10-22uF) tantalum. That's a common thing to do, placed right next to the regulator. 100 nF for high frequency noise; the tantalum for general regulator stability. Newer regulators are stable with ceramic; and will tell you so in the data sheet.

Try soldering a wire or switch to the GPIO0 pin so you can be sure you have it in boot mode. I've had that issue with some NodeMCU boards: while most work fine uploading from USB directly, some needed help with the PGM button.

It is not rare that solutions for biggest problems are pretty obvious.

I used all the time FTDI adapter. This one:
https://www.aliexpress.com/item/32634246159.html
My design is based for it. It has DTR, RX, TX and CTS!!!!

Now, while DTR, RX and TX are important for data upload for MCUs, CTS is important too, but for AVR. Not for an ESP. Damn.

For ESP and auto reset circuit, USB to TTL adapter needs RTS which stands for Request To Send. Clear To Send (CTS) can't help. My first thoughts were, hey, why is for all ESP boards common CH340 and CP2102? Then i check the datasheets for those chips and realize that my circuit is good, but i use wrong adapter. Better said, right adapter, but wrong way. CH340 adapter did a great job and my sketch is on ESP8266. I use Wemos CH340 adapter which has selectable power, and what is more important you can chose between RTS and CTS for uploading sketch to MCUs.
Its this one:

Now, FTDI adapter has CTS on its side holes and it can be soldered and can be used, but it can not be just attached on headers as is. I will go with the CH340 for now on.

I learned few things. First, your suggestions are precious and i will sure do big modifications on next revision. Second, one MUST READ datasheets. No matter you think you know. When you are 100% sure, you made obvious mistakes.

Again, thank you all.

dekip:
Now, while DTR, RX and TX are important for data upload for MCUs, CTS is important too, but for AVR. Not for an ESP. Damn.

Well actually, CTS is completely irrelevant to any of these microcontroller programming ports! :astonished:

It is a signal returned to the "modem" - in this case the PC - to implement flow control. It is never used in Arduinox and is simply jumpered to ground on the Pro Mini. The original FTDI adapters were not designed for Arduino, they were to interface in general to (slow, un-buffered) minicomputers for two-way general data communication where the target may have been unable to cope with the traffic rate.

The Pro Mini itself was designed to match the adapter available at the time rather than the other way around.


Now,
As you observe, this particular CH340 board was designed to interface with an ESP and defaults as purchased, to usefully providing both DTR and RTS. I am curious as to whether there is actually an ESP module to match, other than the one you have designed. In general, it is simpler to use a WeMOS D1 Mini rather than an ESP-12 as the daughterboard as it deliberately provides the programming circuitry.

In the meantime, your discussion here has clarified the cryptic meaning of that "R/C" pin. :sunglasses:

In picture here you provided it has soldered jumper on RTS, but in my case all i ordered came without any pre-soldered jumpers. So, no any defaults. :wink:
But it doesn't change anything. Adapter is good, cheap, and it works as expected. My recommendation.

I didn't said FTDI is designed for AVR, and i didn't know that CTS pin is irrelevant for it. On its side, it has pinout that could match ESP's needs, but i didn't check it out.

For your suggestion to use D1 mini, i use it pretty much everywhere. But, it is more pro to make your own design. Based to proven one, though, but your own.

Here is how it looks like, but not completed yet. It is intended to be put into a wall switch box with a glass face plate. I have a few of it already working for years, but with Amica NodeMCU, phone chargers and 4ch relay modules. Bunch of wires and had a few problems with broken dupont wires etc.

I am glad if i help a little with this topic to someone who come to same problem. That is why this forum is all about. I don't post much, but i read much.
Great community.

dekip:
In picture here you provided it has soldered jumper on RTS, but in my case all i ordered came without any pre-soldered jumpers. So, no any defaults.

Ah well, the picture I provided comes directly from the Aliexpress link you gave! :astonished:

What else can I say!

Ordered three to play with (I have a lot of things in that category!) from a cheaper (postage) Aliexpress dealer who illustrates them without the jumper soldered. Will be interesting. :grinning: