0
\$\begingroup\$

I'm trying to design a development board using an ESP32-S3 MCU. The goal is to have the boot select button act as the lone button as well as do this with a completely analog design:

  • When the development board is plugged in and the boot select button is held down on plug-in, it will enter boot mode.

  • When the boot select button is simply clicked and the board is already powered-up, the board will reset.

After reading the documentation for the ESP32-S3, it seems there are two important pins that I need to manipulate in order to do this: CHIP_PU and GPIO_0. Please see sections 2.5.3 to 2.6.1 of https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf to see the information I'm directly referring to as well as specific timing parameters which are important to this circuit.

Multiple things need to happen in order for this scheme to work:

  1. CHIP_PU needs to have at least a 50 us delay before it's pulled high on power-up for the power rails to stabilize before the chip is activated.
  2. GPIO_0 needs to be pulled to GND within 3 ms after and while CHIP_PU is pulled to the power rails if the boot select button is held down on board plug-in.
  3. CHIP_PU needs to be pulled to GND for 50 us then pulled back to the power rails via the same exact boot select button after the chip has been activated (So after step 1) to enact the reset function.

Accomplishing steps 2 and 3 at the same time is proving to be challenging. I can accomplish steps 1 and 3 by using an RC timer circuit that delays voltage being sent to CHIP_PU to accomplish step 1 and a push button tied to GND to accomplish step 3, but I'm not sure how to use the same exact button to accomplish step 2 because CHIP_PU needs to be pulled high to read GPIO_0 but my current design has both CHIP_PU and GPIO_0 pulled to the boot select button which is pulled to GND which means CHIP_PU will also be pulled to GND on plug-in, preventing the activation of the MCU which prevents GPIO_0 from being read which prevents the chip from going into boot mode. Please see image for current schematic of what I have so far. Schematic of the current circuit as described above The RC values need tuning but that doesn't matter here. My point is, is there any way to accomplish what I want described, done with just analog components and when the button is pressed by a human no less?

\$\endgroup\$
0

2 Answers 2

0
\$\begingroup\$

Although this does not precisely satisfy conditions you specified, it should put the chip into boot mode according to my understanding of the datasheet. This is what I came up with: enter image description here

This relies on a SPDT pushbutton. No values are specified but assume C1 = C2, R1 < R3 and R1 < R4:

  • When power is removed, C1 and C2 are discharged by R2 and R4.
  • When power is applied and S1 is not pressed, PU is immediately driven low by U1 and GPIO0 is driven high by U2. C1 will charge through R1 until it exceeds 1/2 Vdd (or other threshold set by R5 and R6) and PU is driven high by U1 while GPIO0 is driven high by U2.
  • When S1 is pressed for a short time, C1 is immediately discharged and PU is driven low by U1. C2 does also charge through R3 but does not reach enough voltage to exceed threshold before the button is released and C2 starts discharging again through R4.
  • When S1 is pressed long enough, in addition to PU being driven low, C2 will reach enough voltage to exceed the threshold and GPIO0 is driven low by U2. When the button is released, C1 charges up faster than C2 discharges, and such PU will be driven high again before GPIO0 is driven high and the chip should latch into boot mode.
\$\endgroup\$
1
  • \$\begingroup\$ This is pretty much meeting my specifications of functionality. Using comparators is a great idea. I'll play around with this design a little bit! Thank you! \$\endgroup\$
    – Gigoiy
    Commented Mar 10 at 16:02
0
\$\begingroup\$

You could check the schematic in the documentation of the M5 stack, they even use the same button for a third functionality as a user input.

https://docs.m5stack.com/en/core/stamp_pico

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.