Problem with ESP32 EN voltage when connecting an un-powered ESP-PROG adapter - Page 1
Forum section: electronics / beginners

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 24, 2022, 09:19:59 pm
content: I have a board that has an ESP32 on it. I've stumbled upon a weird problem (albeit a minor one) that is occurring with the EN (i.e. /reset) signalling that I'm at a loss to explain.When the board is standalone, everything works fine. When anESP-PROGprogrammer is hooked up to the board (by PROG only, not JTAG) andpowered on(i.e. USB is connected) everything works fine. When the ESP-PROG is hooked up, butun-powered(i.e. USB disconnected), the ESP32 will not start up. I should note that the ESP32 board is powered separately - the programmer does not power it (Vprog jumper is removed).I tracked it down to the voltage on the EN pin not being high enough. In the non-working situation, it only goes to about 1.4V.I don't know what the high-level threshold for the EN pin is supposed to be, but that obviously isn't enough. Espressif only give a Vil(nRST)figure, of 0.6V. In the working situation, EN goes all the way to 3.3V as expected.On the EN line of the ESP32 board I have the recommended 10k pull-up and 1uF decoupling/delay capacitor, plus it also goes to the C input pin of a 74LVC1G57 (which I guess should be high-impedance and have no effect). So, there can't (or shouldn't) be anything on-board pulling it down, so my suspicions are on the ESP-PROG board. On that side, the EN line goes to: the collector of one of the NPN transistors that make up the auto-reset circuitry; a tactile button (the schematic also shows a 10k pull-up resistor and 1nF de-bouncing cap on that, but they're marked "NC", and are indeed not populated on my example); and, the 'A' input pin of a 74VHC1GT04.I just can't work out what is pulling the EN voltage low.Anybody got any ideas?

author: mclute0
author_rank: Regular Contributor
timestamp: August 25, 2022, 04:40:23 am
content: generally, espressif en pin isHigh: On; enables the chipLow: Off; the chip powers offNote: Do not leave the pin floating.andVIH High-level input voltage 0.75 × VDD1 — VDD1+ 0.3 VVIL Low-level input voltage –0.3 — 0.25 × VDD1 Vbut see your chips datasheet.also for like the wroom32e, there is a note:To ensure that the power supply to the ESP32 chip is stable during power-up, it is advised to add an RCdelay circuit at the EN pin. The recommended setting for the RC delay circuit is usually R = 10 kΩ and C =1 µF. However, specific parameters should be adjusted based on the power-up timing of the module andthe power-up and reset sequence timing of the chip. For ESP32’s power-up and reset sequence timingdiagram, please refer to Section Power Scheme in ESP32 Series Datasheet.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 25, 2022, 12:01:43 pm
content: Thanks for copying and pasting from the documentation and not reading what I wrote.Power supply sequencing is perfectly fine and within spec. It's just that when the un-powered ESP-PROG is connected to the EN line, the voltage never rises high enough for the ESP32 to come out of reset. This is what EN (yellow) looks like versus VDD (pink) when the ESP32 fails to start up:(Sorry for the crappy photo rather than screen cap - I couldn't find a spare USB memory stick.)There is about 1.8 ms between VDD passing the minimum threshold (2.3V I believe) and EN rising above Vil(nRST)of 0.6V. The minimum is 50 us, so way more than enough time.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 25, 2022, 12:44:49 pm
content: I did some experimentation.Putting a meter measuring current (on 200 uA range) in series with the EN connection between ESP32 and ESP-PROG, I measure 141 uA current flowing from the ESP32 to the ESP-PROG in the situation where the ESP32 fails to start. I guess this is enough to drop the voltage, although by my reckoning, pulling current from 3.3V through a 10k resistor it would have to be more like 190 uA to drop to 1.4V.If I disconnect the GND connection from the ESP-PROG, the ESP32 starts up fine, but I observe weird drop-outs, about 1V drop for a few ms, at averyregular 1 Hz frequency on the EN line. Not enough to reset the ESP32, though. Disconnecting EN from the ESP-PROG causes this to stop.

author: Manul
author_rank: Super Contributor
timestamp: August 25, 2022, 01:42:22 pm
content: If I read and understood correctly, nothing is surprising here. If programmer circuit is unpowered it is very normal that it sinks some current through ESD diodes into it's own power rail. There also digital inputs and outputs which have diode to negative rail and a TVS. These will sink negative voltages, but for possitive voltage you need to go above TVS voltage. Such inputs and outputs might be truely high impedance when unpowered (within reasonable voltage range).This is easy to test. Just take a multimeter, set to diode test mode and measure from ground to some logic circuits when they are not powered. You often find voltages of around 0.5 - 0.8V which means that at this voltage they start parasitically sinking current.There is also a secondary effect: if unpowered power rail rises (through that parasitic sinking), some logic gates might start partially working. Then the sinking becomes really unpredictable.There was an old eevblog video which might be interesting for you:

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 25, 2022, 02:56:28 pm
content: If that's the case - parasitic draw through protection diodes - then I'm thinking it has to be the 74VHC1GT04 on the ESP-PROG. If that is passing current through a protection diode to a power rail, I can see from the ESP-PROG schematic that it is likely to be trying to power both a 74AHC125 and possibly the FT2232 (there's a P-FET between, but body diode might pass current).I wonder if the weird regular 1V dips on the EN are just coincidence that they'reexactly1 Hz, and it's just the decoupling caps on the FT2232 charging up enough to pass some kind of POR circuit and it tries to start up, there's insufficient current, so the voltage dips, it shuts off, EN goes back up.Question is, can I mitigate this somehow?Could I perhaps put a diode in series in the EN connection between ESP32 and ESP-PROG? Anode to ESP32 side. Because as far as I see it, all the ESP-PROG needs to be able to do is pull EN low. Would probably have to make it a schottky diode to ensure it falls below Vil(nRST)of 0.6V.Edit:Wait, that won't help, it will still permit current to flow from ESP32 side to ESP-PROG.Overall, this isn't a huge problem, just an irritating inconvenience; I have to unplug the ESP-PROG from the programming header as well as the USB when not in use, rather than be lazy and only unplug the USB.

author: mclute0
author_rank: Regular Contributor
timestamp: August 25, 2022, 05:53:56 pm
content: I did read where you said, "I don't know what the high-level threshold for the EN pin is supposed to be, but that obviously isn't enough."and I pulled the published formula from a document I use all the time that does tell you.I am sorry if you don't find that helpful... welcome to the 'beginners' forum.IF you want serious help, include a picture of the circuit, if not a schematic. Other than that, you will either get no answers or regurgitated manufacturers information that you seem to be missing.If you want me to do the blind psychic things and just make random educated guesses, here goes.If the ground path through the programmer is lower resistance current may flow and it may be clamped by a diode. got a decade box?

author: Manul
author_rank: Super Contributor
timestamp: August 25, 2022, 07:33:33 pm
content: I guess you could try to power programmer from ESP32 through the diode, thus creating diode OR powering scheme. If USB is connected to programmer it will power normally and not feed ESP32 (because of diode) and if USB power is not present it will be powered from ESP32. Should work, but there could be exceptions. I don't have these devices and never used them.Or add a true open drain control for the EN.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 25, 2022, 07:59:29 pm
content: Quote from: mclute0 on August 25, 2022, 05:53:56 pmMy implied meaning behind that statement was that I don't know because it'snot documented. Espressif only document the Vil(nRST)threshold for the EN pin; they do not document a high threshold. The general Vih/Vilobviously do not apply to the EN pin, as it's low threshold differs from the general one (0.6V absolute vs. ~0.8V for 3.3V VDD).Look, I don't mean to be an arsehole here, but I'm going to say it bluntly:literally nothingin your original post was helpful given the context, and had all the hallmarks of someone who read the thread title and nothing else. Let me dissect by paragraph:Quote from: mclute0 on August 25, 2022, 04:40:23 amTelling me how the EN pin works at such a basic, basic level is pointless. Obviously I know this, otherwise I would never have even got to the fundamental point of having a running ESP32 board.Quote from: mclute0 on August 25, 2022, 04:40:23 amSee my point above regarding assuming the specified behaviour of general GPIO pins actually applies to the EN pin. And even telling me that the logic high thresholdmaybe 0.75*3.3=2.475V doesn't help, because it's blindingly obvious that whatever logic high threshold voltage is in play is greater than what I was getting. It's not like I was making the EN voltage 1.4V on purpose, thinking the logic threshold was something different. So more redundant information.Quote from: mclute0 on August 25, 2022, 04:40:23 amAgain, redundant information. You just quoted a section of the documentation that recommends doing exactly what I hadalreadystated I have in place - to wit: "on the EN line of the ESP32 board I have the recommended 10k pull-up and 1uF decoupling/delay capacitor".I'm sorry if you took offence, but it really bugs me sometimes when forum posters just dive in with generic replies like "Oh, you got a problem with X? You wanna be doing Y and Z" without actually taking in the details of the situation or applying any critical thinking.

author: mclute0
author_rank: Regular Contributor
timestamp: August 25, 2022, 08:23:53 pm
content: And still no schematic, or picture, or decent explanation of what you are doing.You ask questions on a beginner forum and get beginner answers because people assume you are a beginner. That make you mad!have a nice life!