Feather HUZZAH Reset Circuitry

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
MrAureliusR
 
Posts: 18
Joined: Sat Apr 26, 2014 8:51 pm

Feather HUZZAH Reset Circuitry

Post by MrAureliusR »

Hi there. I've been studying the reset circuit on the HUZZAH ESP8266. I can't figure out how it can possibly get into bootloader mode.
Toggling DTR high and then low again is fine, it resets the chip. Toggling RTS high and low again pulls GPIO0 low and high again, while running.
Both high at the same time seems like a dangerous condition, as we end up with almost 4.5V on GPIO0.

So how can it reset the chip with GPIO0 low to get into bootloader mode?
In this thread: viewtopic.php?f=57&t=96475&p=487891&hil ... it#p487891
Mike explained:
The circuit is an XOR, and it exists for compatibility between the ESP8266 and the Arduino IDE Serial Monitor.

If you hold GPIO0 low while RST is low, it puts the ESP8266 in bootloader mode instead of just restarting the firmware. When communicating through a Serial connection, the ESP8266 uses GPIO0 as the RTS signal for flow control.

The Arduino IDE uses both the DTR and RTS signals to reset a chip and launch the bootloader, but its standard signals would put the ESP8266 into flash programming mode instead of just resetting the serial interface.

The XOR allows the Serial connection to use RTS for flow control while the regular firmware is running, but prevents GPIO0 from being held low during reset.
That's all well and good, but why would we want to prevent GPIO0 from being held low during reset? Wouldn't this just boot from flash and not get into bootloader mode? I'm simulating the circuit in EveryCircuit Pro on Android, and I can't figure it out. Are we depending on the ESP8266 holding GPIO0 low for us? That's the only thing I can think of.

User avatar
MrAureliusR
 
Posts: 18
Joined: Sat Apr 26, 2014 8:51 pm

Re: Feather HUZZAH Reset Circuitry

Post by MrAureliusR »

I hate to bump this, but I am writing an article which mentions this and if I can't find out how it works for sure, I will have to re-write that section.
If the support staff don't know off-hand, is there someone else I can contact to ask?

User avatar
adafruit2
 
Posts: 22187
Joined: Fri Mar 11, 2005 7:36 pm

Re: Feather HUZZAH Reset Circuitry

Post by adafruit2 »

the huzzah reset circuitry design is from espressif - we just did what they did :) so you will have to ask them for details

User avatar
isdale
 
Posts: 80
Joined: Wed Dec 15, 2010 12:54 am

Re: Feather HUZZAH Reset Circuitry

Post by isdale »

Is the esp32 circuit similar?
We have a DFPlayer communication on the TX/RX lines of our HUZZAH ESP32 using HardwareSerial(1)
Test code plays one or two tracks and then sends command to loop thru rest of sounds
If the serial monitor closed, the system boots and plays
if you open the Serial Monitor before the loop-sounds command is sent,
the ESP32 resets and then says it cant talk to the DFPlayer.
If you open monitor after the loop-sounds, the DFPlayer continues to autonomously play everything
but the DFPlayer.begin fails.

the inability to use Serial(1) and usb serial for debugging is annoying.

User avatar
adafruit2
 
Posts: 22187
Joined: Fri Mar 11, 2005 7:36 pm

Re: Feather HUZZAH Reset Circuitry

Post by adafruit2 »

yep, espressif uses the same reset circuitry for both!

User avatar
MrAureliusR
 
Posts: 18
Joined: Sat Apr 26, 2014 8:51 pm

Re: Feather HUZZAH Reset Circuitry

Post by MrAureliusR »

adafruit2 wrote:yep, espressif uses the same reset circuitry for both!
Well, it seems to me the only way it could possibly work is to assume that it sets RTS high, pulling GPIO0 to ground. Then DTR is pulled high, and one instruction cycle later RTS is pulled low. So RESET is latched in while GPIO0 is still below the threshold for the LOW state. Otherwise I cannot possibly see how this circuit could work. It's impossible to hold both RESET and GPIO0 low at the same time -- turning on both transistors ends up with an unpredictable state, and can end up with more than the +3.3V on GPIO0. I've simulated it in LTSpice and EveryCircuit and I get confusing results each time. I need to hook up the scope and actually take a look at what is going on.

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”