RTC8M_CLK for LED control

daniel1704
Posts: 6
Joined: Wed Oct 09, 2019 4:48 am

RTC8M_CLK for LED control

Postby daniel1704 » Wed Oct 09, 2019 4:58 am

I'm new in this platform, and I've been designing a simple project with it, to test some things I need for bigger ones. The thing is I wanted to keep a PWM signal while on light sleep. According to the TRM, that's possible with the LEDC low speed channels, if I set LEDC_SCLK to follow RTC8M_CLK (LEDC_APB_CLK_SEL set to 0). I tried to do this using REG_CLR_BIT, but whenever I do this, the PWM signal simply stay still. Do any of you know if there's any activation bit for RTC8M_CLK or any other hidden configuration in the Arduino IDE that keeps this clock idle?

daniel1704
Posts: 6
Joined: Wed Oct 09, 2019 4:48 am

Re: RTC8M_CLK for LED control

Postby daniel1704 » Fri Oct 11, 2019 6:29 am

So I continued working and I found there are a couple of bits that power up and enable the 8 MHz clock in the RTC_CNTL_CLK_CONF_REG register. I managed to make the PWM work in regular power mode (no sleep), but the signal stays idle as soon I start light sleep mode. I set all the RTC domains (peripherals, both memories and XTAL) to be ON using esp_sleep_pd_config() and nothing changes. Any ideas on this?

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

Re: RTC8M_CLK for LED control

Postby boarchuz » Fri Oct 11, 2019 8:38 am

Hopefully someone who knows what they're talking about will chime in, but I'll throw in a few thoughts in the meantime:

Are you using the API? I'm sure you'll have a lot more luck with that than starting from scratch fiddling with individual registers, at least as a starting point for your own custom implementation.
https://docs.espressif.com/projects/esp ... /ledc.html
especially ledc_clk_cfg_t for ledc_timer_config() and ledc_clk_src_t for ledc_timer_set()

There's also a note in there that might be relevant:
For additional details regarding speed modes, refer to ESP32 Technical Reference Manual (PDF). Please note that the support for SLOW_CLOCK mentioned in this manual is not yet supported in the LEDC driver.
Maybe this test using REF_TICK will be a useful example: https://github.com/espressif/esp-idf/bl ... edc.c#L311

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: RTC8M_CLK for LED control

Postby WiFive » Fri Oct 11, 2019 9:19 am


Who is online

Users browsing this forum: No registered users and 70 guests