A long reset press to enter download mode

FRDM4236
Posts: 7
Joined: Mon Dec 19, 2022 12:30 am

A long reset press to enter download mode

Postby FRDM4236 » Mon Dec 19, 2022 2:39 am

Hi All,
Why do most ESP32 boards, including the TinyS2, TinyS3, FeatherS2 and FeatherS3 have 2 buttons for reset and GPIO00? Sometimes two buttons are very close and it's very hard to push with two big fingers. I think that the problem can be solved by using the reset button with a hardware timer. A short reset press will run your code, and a long reset press (press the button until a LED is lit) will enter download mode. It should work every time.

I use 2 inverters in the following circuit for the theory, but in a real application, you can use a buffer to replace two inverters to save cost. I recently made a Small ESP32 board called SmallPICO which does not need two buttons, like the TinyPICO. When I design a S2 or S3 board I will try this approach. I would appreciate it very much if anyone could verify it on a breadboard. It's not very difficult. It worked for me. The 2G14 is not in a DIP package, but you can use a 74HC14 instead on a breadboard. The 470 ohm resistor is to prevent signal contention in case the IO00 becomes an output. If the LED is too dim, you can change the current limit resistor from 10K to 4.7K or 2.7K.

Happy Holidays!
Image
Attachments
2022-12-18.png
2022-12-18.png (58.25 KiB) Viewed 12543 times

FRDM4236
Posts: 7
Joined: Mon Dec 19, 2022 12:30 am

Re: A long reset press to enter download mode

Postby FRDM4236 » Mon Dec 26, 2022 1:57 am

Hi All,
It seems quite a few people are interested in this circuitry. So I would like to show my final circuitry, and the cost can be reduced for putting it into your board.

Below is the low cost version. You can use one of 3 buffers, HC1G50, HC1G08 and HC1G125, so you can always find one.
Do not use a HCT buffer. The chip is a 5 pin IC, the pin1 and pin2 should be tied together.

The Arduino IDE sometimes creates many IO ports when you plug in different boards, it's hard to keep track. Sometimes USB CDC boot does not work every time, fairly frustrating. With this Long Reset Press circuit, you don't even have to check the port number, it will connect to the correct port for your board in the download mode and it will download your sketch hassle free every time. But it does not automatically run your sketch after uploading your sketch. You need a short reset press to run it

Image

For every EE and people who know electronics, the circuit is very understandable, I will explain the circuit in a little more detail for ones who don't know much about electronic circuits.

1. After Power-UP, Va=3V, Vb=3V, Vc=3V, so the LED is off.
2. At the moment the reset button is pressed, Va=0V, Vb=near 3V (because the cap is starting to be charged up, but not being
charged up enough), Vc=3V, the LED is still off.
3. After 1 second, the cap is charged up fully, Va=0V, Vb=0V, Vc=0V, the LED is turned ON. The BOOT pin is 0.
4. When the reset button is released the Vb is discharged via R1 and R2. Before it's nearing fully discharged, Vb is enar 0V, Vc=0V,
The BOOT pin is still at 0 when the reset button is just released. This is how it gets into the download mode.
5. When the cap is fully discharged Vb =3V (this may confuse someone), because the cap is connected to 3V, not connected to
ground. But just remember that if a cap is charged up, both leads have different voltages potentials. When a cap is fully
discharged, both leads have the same voltage potentials regardless of what the voltage potential is.

I hope that you include this circuitry in your next ESP32 board design. It does not occupy more space than the reset button I used on my ESP32 boards.

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: A long reset press to enter download mode

Postby ESP_Sprite » Mon Dec 26, 2022 2:48 am

FRDM4236 wrote:
Mon Dec 26, 2022 1:57 am
Your post seems to be lacking the image.

FRDM4236
Posts: 7
Joined: Mon Dec 19, 2022 12:30 am

Re: A long reset press to enter download mode

Postby FRDM4236 » Mon Dec 26, 2022 3:22 am

Sorry for the missing picture.
Image
Attachments
LRP_20221225.pdf
(76.33 KiB) Downloaded 326 times

rossjoe
Posts: 3
Joined: Tue Dec 27, 2022 7:19 am

Re: A long reset press to enter download mode

Postby rossjoe » Tue Dec 27, 2022 7:24 am

Thanks @FRDM!)

FRDM4236
Posts: 7
Joined: Mon Dec 19, 2022 12:30 am

Re: A long reset press to enter download mode

Postby FRDM4236 » Sat Jan 21, 2023 2:27 pm

I recently made ESP32-S2 and S3 prototype boards with the long Reset Press feature. It worked as I expected, so it can work on your boards as well.

See the video clip at https://www.smallpico.com/LRP_button.mp4

A short reset press will run the sketch, you can see the LED at the up right corner will flash once.

A long reset press will enter download mode, and the LED at the up right corner won't flash but you can hear a familiar chime sound from Windows.

Who is online

Users browsing this forum: Bing [Bot] and 169 guests