Open YSaietGit opened 1 year ago
@YSaietGit I apologize for the delayed response. The issue you mentioned regarding the inability to set a lower LEDC timer frequency is due to the AT documentation not being clear enough, which caused this confusion.
In fact, the frequency of the LEDC timer and the duty resolution are inversely related. If you want to set a lower timer frequency, you need to set a higher duty resolution. In your case, you can set the <duty_res>
parameter to 14, and <duty>
to 8192
.
Below is my test with firmware: target-v2.4.2.0.zip
AT+DRVPWMINIT=3000,14,10
AT+DRVPWMDUTY=8192
AT+DRVPWMINIT=2000,14,10
AT+DRVPWMDUTY=8192
AT+DRVPWMINIT=1000,14,10
AT+DRVPWMDUTY=8192
AT+DRVPWMINIT=8,14,10
AT+DRVPWMDUTY=8192
could you please have a try.
~
Answers checklist.
IDF version.
AT version:2.4.2.0(fb731d2 - ESP32C3 - Aug 25 2022 03:47:31) SDK version:v4.3.2-553-g588436db47 compile time(7f0b5f8):Jun 14 2023 14:08:19 Bin version:2.4.2(MINI-1)
Operating System used.
Windows
How did you build your project?
Other (please specify in More Information)
If you are using Windows, please specify command line type.
None
Development Kit.
Custom board with chip esp32-c3=mini-1
Power Supply used.
External 5V
What is the expected behavior?
On github repository esp-at, I modified AT version 2.4.2.0 to support AT driver commands:
github compiled the release successfully. I loaded the bin file to the chip and used the following commands: AT+DRVPWMINIT=20000,4,10 AT+DRVPWMDUTY=8
The commands work fine and observed a square wave at correct frequency 20Khz and duty 50% as expected.
I then tried reducing the frequency to 1000 and 10 Hz (anything below 5000Hz). The command fails no square wave or square wave at 79KHz is observed.
AT command doc specifies that frequency 1-80MHz is permitted.
What is the actual behavior?
I then tried reducing the frequency to 1000 and 10 Hz (anything below 5000Hz). The command fails no square wave or square wave at 79KHz is observed.
Steps to reproduce.
use at Command for frequency bellow 5KHz AT+DRVPWMINIT=3000,4,10 AT+DRVPWMDUTY=8
or AT+DRVPWMINIT=1000,4,10 AT+DRVPWMDUTY=8
or AT+DRVPWMINIT=10,4,10 AT+DRVPWMDUTY=8
Debug Logs.
No response
More Information.
No response