LED PWM timer control query

stock86c
Posts: 18
Joined: Mon Aug 19, 2019 10:15 am

LED PWM timer control query

Postby stock86c » Fri May 08, 2020 10:12 am

Hi all,

according to the techincal specs, the LED PWM has 4 high speed timers, 8 high speed channels, and 4 low speed timers 8 low speed channels. My questions is how to access all 8 timers, as the PWM example from the ESP-IDF only provides 4 timers configurable.

Below is part of the ledc.h from the IDF
typedef enum {
LEDC_TIMER_0 = 0, /*!< LEDC timer 0 */
LEDC_TIMER_1, /*!< LEDC timer 1 */
LEDC_TIMER_2, /*!< LEDC timer 2 */
LEDC_TIMER_3, /*!< LEDC timer 3 */
LEDC_TIMER_MAX,
} ledc_timer_t;

typedef enum {
LEDC_CHANNEL_0 = 0, /*!< LEDC channel 0 */
LEDC_CHANNEL_1, /*!< LEDC channel 1 */
LEDC_CHANNEL_2, /*!< LEDC channel 2 */
LEDC_CHANNEL_3, /*!< LEDC channel 3 */
LEDC_CHANNEL_4, /*!< LEDC channel 4 */
LEDC_CHANNEL_5, /*!< LEDC channel 5 */
LEDC_CHANNEL_6, /*!< LEDC channel 6 */
LEDC_CHANNEL_7, /*!< LEDC channel 7 */
LEDC_CHANNEL_MAX,
} ledc_channel_t;

as can be seen, there are only 4 timers available for config. Help would be appreciated to configure all 8 timers for configuring 8 different external devices (LEDs or different pwm controllable devices) thx.

ESP_Sprite
Posts: 9723
Joined: Thu Nov 26, 2015 4:08 am

Re: LED PWM timer control query

Postby ESP_Sprite » Sat May 09, 2020 8:44 am

You can select if you want the low- or high-speed timers by setting the speed_mode member of ledc_timer_config_t appropriately; that allows you to configure all 8 timers.

stock86c
Posts: 18
Joined: Mon Aug 19, 2019 10:15 am

Re: LED PWM timer control query

Postby stock86c » Mon May 11, 2020 5:45 am

thx , that worked.

Who is online

Users browsing this forum: Bing [Bot] and 323 guests