Isolate GPIO (not RTC) during deep-sleep

davdav
Posts: 168
Joined: Thu Nov 17, 2016 2:33 pm

Isolate GPIO (not RTC) during deep-sleep

Postby davdav » Wed Jun 05, 2019 11:53 am

Hi everybody,

I have the necessity to isolate some GPIO (not RTC) like GPIO16, GPIO18, GPIO22 and GPIO23 during deepsleep in ESP32-WROOM32D module.

In my case GPIO22 and GPIO23 are outputs and using

Code: Select all

	gpio_hold_en();
	gpio_deep_sleep_hold_en();
I'm able to fix their status during deep-sleep and wakeup stub.


GPIO16 and GPIO18 are used for I2C bus and have external pull-up resistors. Before entring in deep-sleep should I change them to output mode, set high level and hold their status? Or they are automatically isolated from the external resistors?

ESP_houwenxiang
Posts: 66
Joined: Tue Jun 26, 2018 3:09 am

Re: Isolate GPIO (not RTC) during deep-sleep

Postby ESP_houwenxiang » Wed Jun 12, 2019 2:10 am

Hi, davdav
You do not need to reconfigure the GPIO mode before entering deep-sleep. When `gpio_deep_sleep_hold_en` is called, all digital GPIOs will remain in their current state. But after the chip wakes up from deep sleep and calls `gpio_deep_sleep_hold_dis`, all digital GPIOs will be reset to the default mode. In this case, you need to reconfigure the GPIO before this function call.

thanks !!
wookooho

davdav
Posts: 168
Joined: Thu Nov 17, 2016 2:33 pm

Re: Isolate GPIO (not RTC) during deep-sleep

Postby davdav » Wed Jun 12, 2019 9:17 am

ESP_houwenxiang wrote:
Wed Jun 12, 2019 2:10 am
Hi, davdav
You do not need to reconfigure the GPIO mode before entering deep-sleep. When `gpio_deep_sleep_hold_en` is called, all digital GPIOs will remain in their current state. But after the chip wakes up from deep sleep and calls `gpio_deep_sleep_hold_dis`, all digital GPIOs will be reset to the default mode. In this case, you need to reconfigure the GPIO before this function call.

thanks !!
Thank you @ESP_houwenxiang,

In practice, if device wakes-up and I DON'T call `gpio_deep_sleep_hold_dis`, digital GPIO (not RTC) inputs should work as before entering in deep-sleep, right? I.e. in my particular case GPIO16 and GPIO18 will still work as I2C bus. Consider that at every start-up (not regarding if it is a wake up from or a power-on) I init the I2C driver.

However, I will do some test in order to understand how it works, because documentation in my opininon is not so clear regarding the "hold" functionality.

thanks

ESP_houwenxiang
Posts: 66
Joined: Tue Jun 26, 2018 3:09 am

Re: Isolate GPIO (not RTC) during deep-sleep

Postby ESP_houwenxiang » Thu Jun 13, 2019 9:39 am

Yes, all states will remain in the state before sleep. the GPIO can not input or output as you wanted. so, `gpio_deep_sleep_hold_dis` should be called if you want I2C bus works.
wookooho

Who is online

Users browsing this forum: Baidu [Spider], Majestic-12 [Bot] and 17 guests