Debugging my ESP32 Programmer

I will be using the EPS32 in a lot of new designs so I decided to make my own programmer. It uses the genuine FTDI232 chip and brings out all the UART lines to a header. The idea is that I would put a female header on my new designs and just plug this programmer in to do the programming. The pinouts would match so I wouldn't have to fiddle with an interconnecting cable.

The programmer design was pretty straight forward. I added a 3.3V voltage regulator and a switch so the Vcc pin on the header could be either 3.3V or 5V (for programming other devices). LEDs are on the TX and RX lines like most programmers. When connected to the PC, the computer sees the FTDI chip and a COM port is established.

On the ESP32 side, I implemented the same interface circuitry that connects the DTS and RTS lines to EN and IO0 that is used on the EPS32 development board. I know this board works fine because I use another ESP32 interface board to program it. (That board has that same interface circuitry on it and connects directly to the EN and IO0 pins.)

My attempts a programming have not worked. The programmer connects to the PC fine. The IDE compiles and attempts to upload the program. The TX and RX LEDs blink but the upload does not complete and the connection times out.

The schematic of the programmer and the ESP32 interface are attached.

Any thoughts would be greatly appreciated.

I took a quick look at the schematics. The look OK. Can you do a loop back test to see if the adapter is working? Try TX with RX also try DTR DSR, RTS CTS.

I use terminal by Bray++. It has all of the features that you will need.

The loop back test with RX and TX connected works fine. How do I test for the others. (Later today I was just going to put DTR and RTS on the scope to see if they are changing state.)

Is there a setting in the IDE that I have to use so that hardware flow control is used?

Thanks.

Use terminal by Bray+.DTR RTS are toggle switches and DSR CTS are indicator lights in the program.

Well that was interesting. It looks like RTS is always active.

When I connect RTS to CTS and toggle RTS, CTS stays active.
When I connect DTR to CTS and toggle DTR, CTS toggles.
When I connect DTR to DSR and toggle DTR, DSR toggles.
When I connect RTS to DSR and toggle RTS, DSR stays active.

Probably short circuit near RTS pin since the FT232RL has tight pitch. The terminal is nice, right? I wish the author continues to improve the software though.

We get closer but the plot thickens.

I took a very close look at the FTDI chip and couldn't see anything obvious but I gave it a touchup to be sure the solder points were good. I installed Terminal on my laptop in that lab and viola, everything looks good. I went back to my office where I do the programming and no joy. Same issue. &^*&%$

As it turned out, on my office computer, the handshaking setting was set for RTS/CTS where it was set to NONE on my laptop. When I set it back to NONE, all was fine. So I either had a solder issue or not but I did have a setting problem.

Using Terminal, when I hit RTS and hit it again, the device resets. I see the traffic from the ESP32 so I know the programmer is doing its job. When I hit DTR and then hit RTS, the device also resets.

When I use the Arduino IDE or Visual Studio with Visual Micro (the IDE I usually use), it just does not go into programming mode.

Terminal is quite the program. I wish I knew what half of it did.

Another update.

I think my programmer is just fine. I have another programmer that has DTR and RTS available. (The reason I designed my own was because like the one I bought, the 3.3 regulator is under powered for ESP32 and so you get brownout errors. The other reason is that like this one, DTR and the other pins are not on the same header so interconnect is a pain.)

Anyway, that programmer fails just like mine does. I think the problem is in one of two areas. One is that I somehow have something wrong with the interface on the ESP32 board I designed. The other possibility is that there is some setting in the upload tool that has to be changed.

Now this is one for the books....

Back to the simplest test. I used the Arduino IDE and a canned ESP32 sketch. (ESP32BLE-UART because it doesn't use any GPIO pins.)

Using my laptop, success! The program uploads just fine with my programmer.
Using my office computer, no joy.

The office computer is an HP z400 workstation. The laptop is a pretty old HP EliteBook.

They both have the same version of Windows 10, the same FTDI USB-COM driver version, the same Arduino IDE version, and the same settings in the IDE.

I have programmed lots of devices through my office computer but this is the first time I am programming a board of mine that has that NPN transistor interface to EN and IO0.

I wonder if there's any issue with the timing of the DTR and RTS between your new office desktop and your old laptop. Do you have a logic analyzer to tap into DTR, RTS, EN, IO0, and TX RX? You can see if the timing between your desktop is somehow different from that of your laptop. You already tried a number of things so this is the only one I can think off at the moment.

BTW, I use N-channel MOSFETs instead of NPN BJTs.

Yeah, I thought it might be timing but if it is, I wouldn't know what to do about it.

No analyzer but I can try it with a scope.

I am using NPN BJTs because I wanted to closely mimic what Espressif does on their development board. I used a the Nexperia device because it is a dual NPN in on package. It's such a simple use for those transistors so I can't imagine that the difference between what they use and what I use is that sensitive in some subtle timing difference between the two computers.

On a side note, while I was waiting for my programmer PCBs, I bought a rather nifty programmer.
ESP32 Programmer

It holds the bare ESP32 so you can program it before installing it onto your PCB. I suppose that would be for burning the ESPs before assembly onto boards that don't have any programming support.

It also has headers for all of the ESP pins. That is how I programmed my boards before I had my programmer. I connected Vcc, GND, TX, RX to my board using my header. I tacked on posts connected to EN and IO0 and connected them to the programmer so in essence, the ESP on my board was now installed in the programmer. That worked fine so I could test my board. I do not have a schematic but I can see what I believe to be the same transistor interface on that programmer as is on my board and the ESP dev board. Here is the rub. THAT programmer works fine on my office computer!

Taking a closer look at the difference between the transistors they use and the one I use, in general, the Nexperia device is higher rated but in this application, who cares about max collector-emitter voltage and max current rating. However, the base-collector saturation voltage on the Nexperia device is 200mV where the SS8050-G device is 500mV. That means that the Nexperia device see a logic hi at a lower voltage where the other device needs a harder hi to turn on. It shouldn't make a difference bit I wonder if it does.

By the way, thanks for the help.

You are welcome! Could be me on the receiving end of the help. I have that programmer as well. I trimmed off the bottom pins so I could program wrover modules as well, before the designer made one just for the wrovers. It uses a cp210x chip. Now to think about it, have you ever succeed using a programmer or dev board with ft chip on your desktop?

As a matter of fact, no. I have that other programmer that doesn't have DTR brought out to a header but it does have that line brought to a row of holes on the board where a header can be added. I have done that and no, it does not work on my office computer.

Where I am is that my laptop and office computer works fine when programming ESP development boards, i.e. where the FT chip is on board. They also both work when using that programmer that does the USB-to-EN/IO0 decoding.

My laptop works fine programming any board, including those of my design, that have the NPN BJT interface circuitry on board but my office computer does not and it doesn't matter which programmer I am using.

I'm not aware of which dev board comes with an ftdi chip. All dev boards I have come with cp2102 series of ics. Could you cross check the ftdi driver settings between your computer's?

I meant FT chip in the generic sense. I checked the FTDI drivers on both computers and they are exactly the same, v2.12.28.0 dated 8.16.2017

If you go into device manager and display the properties and then advanced options, are they still the same?

They are exactly the same.

I will put the scope on both computers to see what the timing difference is. With few options to try, I ordered a different NPN pair that is in the same package as the one I used but has the same base-emitter voltage as the one that Espressif uses. I don't have much confidence that that will solve the problem but hey, it wouldn't be the first time that what I thought wasn't the problem was the problem.

Oh, and on the subject of the CP2102 devices. I would gladly use those devices but for now, I am soldering these by hand and that device does not come in a convenient package.

I know that a reflow oven is in my future but for now, a steady hand, good soldering equipment, and a set of magnifying lenses will have to do.

I am taking steps backwards now. Neither computer or programmer is programming any of my boards.

Shouldn't I be able to put the ESP32 into programming mode using just Terminal by:

Click DTR on to make that low
Click RTS on to make that low
Click RTS off to make that high
Click DTE to make that high

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.