1
\$\begingroup\$

I have an ESP8266 with two buttons connected to pulled-up GPIO4 and GPIO14. The buttons pull the signal down if pressed. I want to reset the microcontroller on every raising edge. I thought about adding two diodes, so that the readings of one button don't get messed up by another button. The buttons are pulled up by internal resistors in the code. But my circuit doesn't seem to do what I wanted: enter image description here

What it should do: The two buttons are in a case. When one of them is pressed, the ESP wakes up from deep sleep. It then reads the values on GPIOs and sends them via WiFi. After that it listens for a falling edge (via interrupt) on those two GPIOs and restarts in software and then goes to sleep if the buttons are pressed down. So it's in deep sleep with a low signal on RST, if I release the button RST goes high and the ESP wakes up.

\$\endgroup\$
9
  • \$\begingroup\$ So what does the circuit do and what did you want it to do? Yes, pushing either button will bring RST down. \$\endgroup\$
    – Justme
    Jan 8, 2022 at 17:01
  • \$\begingroup\$ Thanks for pointing out, @Justme! I included additional information. \$\endgroup\$ Jan 8, 2022 at 17:05
  • 1
    \$\begingroup\$ Add a pull-up to RST? \$\endgroup\$ Jan 8, 2022 at 17:09
  • \$\begingroup\$ Oh I forgot to draw it, there is a pull-up resistor on RST \$\endgroup\$ Jan 8, 2022 at 17:09
  • 1
    \$\begingroup\$ The datasheet says reset pin is active low. Are you sure it only resets on rising edge? \$\endgroup\$
    – Justme
    Jan 8, 2022 at 17:48

1 Answer 1

0
\$\begingroup\$

Probably what’s happening is that when the button is released, by the time RESET completes and the code starts the GPIO state is gone. You’ll need to hold the GPIO state long enough so your program can read it. Perhaps add some R-C delay?

\$\endgroup\$

Your Answer

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

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