๐ถ ESP32 PWM Frequency Calculator
Calculate frequency, resolution, and duty cycle for the ESP32 LEDC peripheral.
Range: 1 Hz to 40 MHz (limited by resolution)
Actual Frequency
5000 Hz
Duty Steps
256
Timer Clock
80 MHz
Period
200 ยตs
๐ Arduino code for this config:
ledcSetup(0, 5000, 8); ledcAttachPin(2, 0);
Frequency vs Resolution Reference
| Resolution | Duty Steps | Max Frequency | Best For |
|---|---|---|---|
| 16-bit | 0โ65535 | ~1 kHz | Smooth LED dimming, precision control |
| 15-bit | 0โ32767 | ~2 kHz | Fine analog emulation |
| 13-bit | 0โ8191 | ~10 kHz | General precision PWM |
| 12-bit | 0โ4095 | ~20 kHz | LED dimming, audio |
| 10-bit | 0โ1023 | ~78 kHz | Motor control, fast PWM |
| 8-bit | 0โ255 | ~312 kHz | Servo, high-frequency switching |
| 1-bit | 0โ1 | ~40 MHz | Digital signal generation |
๐ Learn more about ESP32 PWM pins, LEDC API, and code examples.
Interactive Pinout Tool