Chapter 4. Software framework
When using ESP8266 to generate PWM by directly writing to the register of the hardware timer FRC1, I
found there are error PWM outputs after Wi-Fi is initialized since it may disturb the interrupt of FRC1. Is
it possible to use FRC2 instead to generate PWM? Or is it possible to set FRC1 higher priority than Wi-Fi?
FRC2 cannot be used as it is occupied by the system. Wi-Fi uses NMI interrupt, which have
a higher priority than other ordinary interrupts. It is recommended to use the PWM library of
ESP8266_RTOS_SDK. Please refer to
I' m using v3.3.3 version of ESP-IDF to test the ledc example on ESP32. The LED PWM outputs when Auto
Light Sleep mode is disabled, but does not output when this mode is enabled. According the description of
LED PWM in ESP-IDF programming guide, LED PWM should work in sleep modes. What is the reason?
v3.3.3 does not support LED PWM working in sleep modes. Please use the LEDC example under the
new versions of ESP-IDF (v4.0 and later versions) to test, e.g., ESP-IDF release/v4.2 version of the
SDK. Plus, it is also necessary to change the LED PWM clock source to the internal RTC_8M clock
source. Please see below:
ledc_timer_config_t ledc_timer
.duty_resolution
.freq_hz
.speed_mode
.timer_num
.clk_cfg
};
Does ESP32 PWM support complementary outputs with dead bands on two channels?
• This feature is not supported by LEDC but by the MCPWM peripheral.
• By measurement, ESP32-S3 can generate complementary output waveforms with the frequency of 10 k, the
duty cycle accuracy of 1 us and the dead band accuracy of 100 ns by MCPWM.
4.4.8 Motor Control Pulse Width Modulator (MCPWM)
Does ESP32 support using the MCPWM Timer to trigger AD sampling?
No, it does not.
Can ESP32-S3 generate fully complementary PWM with accurate clock and duty cycle and adjustable dead
band?
By measurement, ESP32-S3 can generate complementary output waveforms with the frequency of 10
k, the duty cycle accuracy of 1 us and the dead band accuracy of 100 ns by MCPWM.
4.4.9 Pulse Counter (PCNT)
Espressif Systems
ESP8266_RTOS_SDK/examples/peripherals/pwm
=
{
=
LEDC_TIMER_13_BIT,
=
5000,
=
LEDC_LOW_SPEED_MODE,
=
LEDC_TIMER_0,
=
LEDC_USE_RTC8M_CLK,
Submit Document Feedback
73
example.
Release master
Need help?
Do you have a question about the ESP and is the answer not in the manual?