Skip to content
esp-labsESP32-S3 bench guide
All blocks

Timing

LED PWM

Eight PWM channels that dim and fade LEDs on their own

runs on the board

Loading the 3D view…

  • PWM
  • Timer

Key facts

In our labs

1 lab uses this block, in 1 track. Open a track to see them.

  • done by you
  • runs on the board
  • built, not flashed
  • planned

Key registers

LEDC_CHn_CONF0_REGoffset 0x0000 + 0x14·n
LEDC_CHn_CONF0_REG
BitsFieldWhat it does
4LEDC_PARA_UP_CHnApply the new duty and settings.
2LEDC_SIG_OUT_EN_CHnOutput on.
1:0LEDC_TIMER_SEL_CHnWhich of the four timers this channel follows.

Technical reference §35.5

LEDC_CHn_DUTY_REGoffset 0x0008 + 0x14·n
LEDC_CHn_DUTY_REG
BitsFieldWhat it does
18:0LEDC_DUTY_CHnDuty: the count at which the output goes low.

Technical reference §35.5

LEDC_CHn_CONF1_REGoffset 0x000C + 0x14·n
LEDC_CHn_CONF1_REG
BitsFieldWhat it does
31LEDC_DUTY_START_CHnStart a fade.
30LEDC_DUTY_INC_CHnFade up (1) or down (0).
29:20LEDC_DUTY_NUM_CHnNumber of fade steps.

Technical reference §35.5

LEDC_TIMERx_CONF_REGoffset 0x00A0 + 0x8·x
LEDC_TIMERx_CONF_REG
BitsFieldWhat it does
21:4LEDC_CLK_DIV_TIMERxClock divider; the low 8 bits are the fraction.
3:0LEDC_TIMERx_DUTY_RESCounter range: the duty resolution in bits.

Technical reference §35.5

LEDC_CONF_REGoffset 0x00D0
LEDC_CONF_REG
BitsFieldWhat it does
1:0LEDC_APB_CLK_SELClock for all timers: 1 APB_CLK, 2 RC_FAST_CLK, 3 XTAL_CLK.

Technical reference §35.5

Read the full sectionTechnical reference §35