Page 1 of 1

Enabling RTC GPIO Pullup resistors

Posted: Sun Mar 10, 2019 7:20 pm
by 0ldG33z3r
Goal: to enable RTC GPIO pullup resistors in deep sleep (to save a lot of potentially extra resistors).

As best I can tell, in the Espressif IDF one can use rtc_gpio_pullup_enable(pin) to enable the pullup resistor, and keep it enabled in deep sleep. There are similar functions for the pulldown resistor, and also some necessary functions to "disconnect" the pin from the RTC later, but enabling the pullup in deep sleep certainly seems possible.
It also seems possible in the Arduino ESP32 core (rtc_io.h), but that header contains the comment "* This function only works for RTC IOs. In general, call gpio_pullup_en, which will work both for normal GPIOs and RTC IOs," which suggests that simply calling pinMode(WAKEUP_PIN, INPUT_PULLUP) ought to achieve the desired effect. I'm in the process of testing that, but I would be grateful if someone could confidently provide guidance about how to reliably maintain the RTC GPIO pullup (or pulldown) resistors during deep sleep, so that I don't have to rely on (sometimes incorrect) empirical evidence.

Any code examples?

Thanks!

Re: Enabling RTC GPIO Pullup resistors

Posted: Mon Mar 11, 2019 5:12 am
by boarchuz
You may well need rtc_gpio_hold_en

https://docs.espressif.com/projects/esp ... gpio_num_t

(And rtc_gpio_hold_dis on wakeup.)