You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PWM is in my opinion 100% smooth and stable as I did not notice any flaws in in the past.
Now I am in the process of upgrading to Sming 3.7.0, ESP SDK 3.0.0 and to use new_pwm instead of SDK-PWM.
It is working smoothly now but I noticed that the PWM produced by new_pwm is less stable compared to SDK-PWM. When fading I see very short flashes every few seconds.
The effect is also visible in the demo Basic_HwPWM. I modified it slightly to this:
#include <user_config.h>
#include <SmingCore/SmingCore.h>
#include <HardwarePWM.h>
uint8_t pins[8] = {4, 5, 0, 2, 15, 13, 12, 14}; // List of pins that you want to connect to pwm
HardwarePWM HW_pwm(pins, 8);
Timer procTimer;
int32 i = 0;
bool countUp = true;
int maxDuty = HW_pwm.getMaxDuty();
int32 inc = maxDuty / 15;
void doPWM()
{
if(countUp == true) {
i += inc;
if(i >= maxDuty) {
i = maxDuty;
countUp = false;
}
} else {
i -= inc;
if(i <= 0) {
i = 0;
countUp = true;
}
}
HW_pwm.analogWrite(14, i);
}
void init()
{
Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
Serial.systemDebugOutput(true); // Enable debug output to serial
const int period = int(float(1000)/(float(339)/float(1000)));
HW_pwm.setPeriod(period);
maxDuty = HW_pwm.getMaxDuty();
// WIFI not needed for demo. So disabling WIFI.
WifiStation.enable(false);
WifiAccessPoint.enable(false);
// Setting PWM values on 8 different pins
HW_pwm.analogWrite(14, maxDuty);
debugf("PWM output set on all 8 Pins. Kindly check...");
debugf("Now Pin 2 will go from 0 to VCC to 0 in cycles.");
procTimer.initializeMs(50, doPWM).start();
}
When running, every couple of seconds a subtle flashing of the LED is visible. It is really short, like the blink of an eye but it is noticable. I tested several times back and forth and the SDK-PWM does not show this effect using same code.
I am not using new_pwm anymore due to this flickering problem so I cannot say. Also I am still on 3.8.0. But as far as I know there were no commits to new_pwm in ages so I don't think the chances of a changed behavior is very high.
pljakobs
pushed a commit
to pljakobs/esp_rgbww_firmware
that referenced
this issue
Mar 10, 2024
I have been using the ESP-PWM for quite a while in this project (LED controller):
https://github.com/verybadsoldier/esp_rgbww_firmware
The PWM is in my opinion 100% smooth and stable as I did not notice any flaws in in the past.
Now I am in the process of upgrading to Sming 3.7.0, ESP SDK 3.0.0 and to use new_pwm instead of SDK-PWM.
It is working smoothly now but I noticed that the PWM produced by new_pwm is less stable compared to SDK-PWM. When fading I see very short flashes every few seconds.
The effect is also visible in the demo
Basic_HwPWM
. I modified it slightly to this:When running, every couple of seconds a subtle flashing of the LED is visible. It is really short, like the blink of an eye but it is noticable. I tested several times back and forth and the SDK-PWM does not show this effect using same code.
It might be related or even identical to this: StefanBruens/ESP8266_new_pwm#9
The hardware used for the LED controller is described here (might be relevant):
https://github.com/patrickjahns/esp_rgbww_controller
The text was updated successfully, but these errors were encountered: