• 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 6 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 6 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

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 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.