ledc doesn't work after restart or deep sleep wakeup

Auxal3000
Posts: 3
Joined: Wed Dec 04, 2019 3:55 pm

ledc doesn't work after restart or deep sleep wakeup

Postby Auxal3000 » Thu Feb 27, 2020 2:52 am

Hello
I'm using a ESP32 CAM that has a Led-flash included. I initialize the led in the program and it works ok. But if I call ESP.restart() or after a sleep wake up and the ledc is always of.
I don't know what to do.
Thanks for any help

Auxal3000
Posts: 3
Joined: Wed Dec 04, 2019 3:55 pm

Re: ledc doesn't work after restart or deep sleep wakeup

Postby Auxal3000 » Thu Feb 27, 2020 10:51 am

I forgot to send the code:

Before setup:

Code: Select all

#define ledFlash           4 
into setup():

Code: Select all

    ledcSetup(LEDC_CHANNEL_7, 12000, 9); 
    ledcAttachPin(ledFlash, LEDC_CHANNEL_7);
    ledcWrite(LEDC_CHANNEL_7, 0);
into loop():

Code: Select all

 ledcWrite(LEDC_CHANNEL_7, 50);

Auxal3000
Posts: 3
Joined: Wed Dec 04, 2019 3:55 pm

Re: ledc doesn't work after restart or deep sleep wakeup

Postby Auxal3000 » Tue Mar 03, 2020 11:07 pm

Solution found

I have seen that before to enter to sleep mode I used the instruction:

Code: Select all

rtc_gpio_hold_en(GPIO_NUM_4);
This block this GPIO to prevent any changes in this pin.
After restart, the chip must execute the instruction:

Code: Select all

rtc_gpio_hold_dis(GPIO_NUM_4);
to unblock it.

Who is online

Users browsing this forum: No registered users and 92 guests