Change LEDC frequency and pwm on the fly without glitches
Posted: Mon Nov 30, 2020 10:59 pm
Hello to every one.
I'm trying set LEDC frequency and PWM on the fly and the code works but not the way I'm expecting, there are bumps or glitches every time de frequency gets changed and also the PWM has glitches but is a little less notorious.
For both Frequency and PWM I need a glitch free transitions and frequencyresolution should be at least 0.1 Hz.
I'm using arduino-esp32 esp32-hal-ledc.h, esp32-hal-ledc.c
I've read on ESP32_TECHNICAL_REFERENCE_manual that using LEDC High Speed Channels transitions are glitch free.
But I don't know how to achieve it primarily because I'm not a C/C++ programmer and I'm very new to ESP32.
Below is a basic code I'm using. Any advice will be very wellcome
Best regards
Fernando
I'm trying set LEDC frequency and PWM on the fly and the code works but not the way I'm expecting, there are bumps or glitches every time de frequency gets changed and also the PWM has glitches but is a little less notorious.
For both Frequency and PWM I need a glitch free transitions and frequencyresolution should be at least 0.1 Hz.
I'm using arduino-esp32 esp32-hal-ledc.h, esp32-hal-ledc.c
I've read on ESP32_TECHNICAL_REFERENCE_manual that using LEDC High Speed Channels transitions are glitch free.
But I don't know how to achieve it primarily because I'm not a C/C++ programmer and I'm very new to ESP32.
Below is a basic code I'm using. Any advice will be very wellcome
Best regards
Fernando