ESP32 -- RTS & DTR with Transistor Network

tpayne03
Posts: 19
Joined: Thu Oct 05, 2017 8:24 pm

ESP32 -- RTS & DTR with Transistor Network

Postby tpayne03 » Fri Oct 06, 2017 6:55 pm

Hi,

I'm laying out the ESP32, and I'm getting a grip on laying out the serial connection using the ESPTool.py.

I understand you are using the RTS and DTR pins to toggle EN and GPIO0 on the ESP32 to flip it to the bootloader to flash an image.

I'm not super familiar with RS-232 protocol, and bit banging serial bits -- I understand TTL though.

I saw a sub-note about some additional hardware being added to ensure some kind of condition where the chip doesn't reset correctly if RTS and DTR occur at the same time ("hardware control flow"). I'm assuming that's kind of a standard handshake for RS-232 or something.

We are (of course...) building out the cheapest possible product using the ESP32. If we use the ESP loading tools, do we need to build out that little transistor network that can be found at ESP-WROVER-KIT_SCH-3.pdf?

(I saw an earlier version of that network in the Sparkfun ESP32 "The Thing" schematic, as a clue...).

I haven't worked out the exact logic flow, but I see you guys also added a transistor going to GPIO2 in a later revision... should we be putting in those transistors to ensure reliable loading even when using the ESPTool.py?

Thanks,
-Tim

tpayne03
Posts: 19
Joined: Thu Oct 05, 2017 8:24 pm

Re: ESP32 -- RTS & DTR with Transistor Network

Postby tpayne03 » Thu Oct 12, 2017 7:49 pm

*BUMP*

I'm laying this out now in Altium.

I'd prefer not to put in the NPN transistors, if it is not neccesary.

Can anyone clarify for certain?

tpayne03
Posts: 19
Joined: Thu Oct 05, 2017 8:24 pm

Re: ESP32 -- RTS & DTR with Transistor Network

Postby tpayne03 » Thu Oct 12, 2017 9:27 pm

Here is what I have in mind without the transistor network.

Pull-up on GPIO02 with DTR, and EN / CHIP-PW with pull-ups and RTS.
RTSESP32.jpg
RTSESP32.jpg (38.5 KiB) Viewed 15715 times
DTRESP32.jpg
DTRESP32.jpg (43.12 KiB) Viewed 15715 times

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: ESP32 -- RTS & DTR with Transistor Network

Postby loboris » Thu Oct 12, 2017 9:50 pm

tpayne03 wrote:I'd prefer not to put in the NPN transistors, if it is not neccesary.
You don't need to use any transistors or RTS/DTR at all, but than you will need to put ESP32 into bootloader mode manually by holding GPIO0 low on reset (using switches or jumpers).
See ESP32 Boot Mode Selection
If you want automatic bootloader, I would recommend to use the known to work circuit from some development board schematics.
If you want to experiment with different solutions (it is possible), try it on a breadboard first, before designing the PCB.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: ESP32 -- RTS & DTR with Transistor Network

Postby ESP_Angus » Thu Oct 12, 2017 11:27 pm

tpayne03 wrote:Here is what I have in mind without the transistor network.

Pull-up on GPIO02 with DTR, and EN / CHIP-PW with pull-ups and RTS.
If you wire DTR to GPIO0 not GPIO2, then the posted schematic will allow esptool.py to automatically put the chip into bootloader mode and flash it (I'm guessing wiring to GPIO2 is a mistake, unless there's something I'm missing?)

You can probably even remove (or DNP) the GPIO0 pullup and have it work, as GPIO0 has a weak internal pullup. Similarly, you may not need the capacitor on the EN pullup (this is recommended when using the two transistors for EN/GPIO0 management but it's probably not necessary when driving directly unless you anticipate noise on the RTS line.)

Otherwise, as loboris says, you will need to put a button or something else on GPIO0 to allow you to go to bootloader mode.

To interact with the ESP32 in this configuration via serial terminal, you'll need to configure your serial program of choice not to assert DTR or RTS. The built-in idf monitor tool ("make monitor") will work, but a lot of other serial programs will need configuration before they work - otherwise by default they assert DTR & RTS (normal RS-232 behaviour). These are both active-low signals so the RTS signal holds the chip in reset for as long as it stays asserted.

tpayne03
Posts: 19
Joined: Thu Oct 05, 2017 8:24 pm

Re: ESP32 -- RTS & DTR with Transistor Network

Postby tpayne03 » Fri Oct 13, 2017 12:08 am

I'm on my phone. Yes my mistake on GPIO2. I was laying it out all day, just wired it wrong as I was leaving work.

I meant to have GPIO2 floating, and that pull up plus signal going to GPIO0.

Thanks for the detailed reply!

Who is online

Users browsing this forum: No registered users and 112 guests