• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 PWM Frequency selection

Q&A Forum β€Ί Category: ESP32 β€Ί ESP32 PWM Frequency selection
0 Vote Up Vote Down
Neville Croucher asked 7 years ago

I have a test system application that requires generating several different frequencies.
When  use the ledcsetup(channel, freq, resolution) command if the channel is β€˜0’ or β€˜1’ the frequency is the same for both channels. Further checking sets the same frequency for both channels 2/3, 4/5 etc. It seems that the lower bit vaule in channel does not distinguish different frequencies.
Is there any more detail on the ledcsetup function?
Many thanks.

1 Answers
1 Vote Up Vote Down
Sara Santos Staff answered 7 years ago

Hi Neville.
I’ve tested that and it seems that channel 0 and 1 share the same frequency, as well as 2 and 3, and 4 and 5.

I don’t know if it has do with the fact that there are 16 hardware channels to produce PWM, but only 8 timers. See what others are discussion about that here: https://github.com/espressif/arduino-esp32/issues/1256

More information about the ledcsetup function code: https://github.com/espressif/arduino-esp32/blob/2fd39b1aff1c1f2be60bbd9b5fbd9c88638b0fcc/cores/esp32/esp32-hal-ledc.c

Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login Β»

Latest Course Updates

  • [eBook Updated] Smart Home with Raspberry Pi, ESP32, and ESP8266 V1.6 September 9, 2025
  • [eBook Updated] Learn LVGL: Build GUIs for ESP32 Projects – Version 1.5 July 7, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright Β© 2013-2025 Β· RandomNerdTutorials.com Β· All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.