EasyManuals Logo

Espressif Systems ESP User Manual

Default Icon
191 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #90 background imageLoading...
Page #90 background image
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 ESP8266_RTOS_SDK/examples/peripherals/pwm example.
Im 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 = LEDC_TIMER_13_BIT,
.freq_hz = 5000,
.speed_mode = LEDC_LOW_SPEED_MODE,
.timer_num = LEDC_TIMER_0,
.clk_cfg = LEDC_USE_RTC8M_CLK,
};
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 73
Submit Document Feedback
Release master

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif Systems ESP and is the answer not in the manual?

Espressif Systems ESP Specifications

General IconGeneral
BrandEspressif Systems
ModelESP
CategoryMotherboard
LanguageEnglish