ESP32 - Pin14 LED

kumart
Posts: 7
Joined: Thu Nov 30, 2017 8:24 pm

ESP32 - Pin14 LED

Postby kumart » Sun Dec 24, 2017 2:34 pm

Hey guys
I am using ESP32 with esp-idf on a ESP32 Thing from Sparkfun.
I have a rgb-LED on pins 12-14. Now i have the Problem that during deep sleep the red led (pin 14) is always slightly shining.
Pin 14 is configured as GPIO --> PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[14], PIN_FUNC_GPIO);

Why is this the case? And is there any possibility to turn off this port during deep sleep?
My deep sleep config is: esp_sleep_pd_config(ESP_PD_DOMAIN_MAX, ESP_PD_OPTION_OFF);

Thanks for your help.

User avatar
urbanze
Posts: 301
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: ESP32 - Pin14 LED

Postby urbanze » Sun Dec 24, 2017 11:31 pm

See RTC HOLD PAD feature, I think this can help you.

kumart
Posts: 7
Joined: Thu Nov 30, 2017 8:24 pm

Re: ESP32 - Pin14 LED

Postby kumart » Mon Dec 25, 2017 6:34 pm

Thanks a lot, urbanze. But that does not seem to be the case...
I added the following code to my main:
rtc_gpio_force_hold_dis_all();
This should disable rtc hold on any rtc-pins. But nothing changed. Any other ideas?
According to the schematic, Pin 14 is also HSPI_CLK. What about this?

User avatar
urbanze
Posts: 301
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: ESP32 - Pin14 LED

Postby urbanze » Mon Dec 25, 2017 7:49 pm

You need to put GPIO LOW and after HOLD this GPIO, like this:

Before, try this two codes and see difference!

Note: You can use any function to set output HIGH, in this case I will use Arduino functions.
Note 2: GPIO 14 has an LED to show hold feature working.

Code: Select all

pinMode(14, OUTPUT);
digitalWrite(14, 1);
delay(500);
esp_deep_sleep(300000000);
How can you see, after ESP32 go to deep sleep, LED go LOW (in theory). Now, try with hold feature.

Code: Select all

pinMode(14, OUTPUT);
digitalWrite(14, 1);
rtc_gpio_hold_en(GPIO_NUM_14);
delay(500);
esp_deep_sleep(300000000);
Now, after deep sleep, LED still HIGH.

You need to put GPIO14 LOW and HOLD, try!

In my test's after deep sleep, GPIO14 go to tri-state or ?? (~1.5V). When use GPIO14>LOW and HOLD, pin still in 0V.

kumart
Posts: 7
Joined: Thu Nov 30, 2017 8:24 pm

Re: ESP32 - Pin14 LED

Postby kumart » Mon Dec 25, 2017 8:18 pm

Wow, thank you for your efforts!
You were right! It works if i set gpio_14 to low and enable hold before going to deep sleep. After waking up, i have to disable the hold so that the LED works again.
That's fine for me, thanks a lot!

User avatar
urbanze
Posts: 301
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: ESP32 - Pin14 LED

Postby urbanze » Mon Dec 25, 2017 8:24 pm

kumart wrote:Wow, thank you for your efforts!
You were right! It works if i set gpio_14 to low and enable hold before going to deep sleep. After waking up, i have to disable the hold so that the LED works again.
That's fine for me, thanks a lot!
Yes! you need to disable hold to use pin after wake up. Good luck with your project :P

Who is online

Users browsing this forum: No registered users and 73 guests