Enabling RTC GPIO Pullup resistors

0ldG33z3r
Posts: 1
Joined: Sun Mar 10, 2019 7:10 pm

Enabling RTC GPIO Pullup resistors

Postby 0ldG33z3r » Sun Mar 10, 2019 7:20 pm

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!

boarchuz
Posts: 605
Joined: Tue Aug 21, 2018 5:28 am

Re: Enabling RTC GPIO Pullup resistors

Postby boarchuz » Mon Mar 11, 2019 5:12 am

You may well need rtc_gpio_hold_en

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

(And rtc_gpio_hold_dis on wakeup.)

Who is online

Users browsing this forum: Google [Bot] and 90 guests