LED controller PWM timer compare values
Posted: Sat Jun 11, 2022 2:23 pm
Hello,
As I've seen it, the LED controller sets up PWM signals on up to 8 output channels. All channels turn on at the beginning of the shared PWM period, so all simultaneously, and then turn off when their individual compare value has been reached in the internal timer.
Is there a way to turn on channels at different times, or compare values? Or at least invert the output so that a channel isn't on during the time from LOW to CMP, but from CMP to HIGH.
I'd like to distribute the channel on-times more evenly to even the load on the PSU and have a less flickering light. One of my main scenarios is a dual-white (CCT) lighting that combines cold and warm white with 2 channels. When the light is on at maximum single brightness (100% of one channel), it doesn't flicker at all. But if it's distributed over two colours, it starts flickering again. This can be avoided if both colours (channels) simply alternate instead of partially overlap. Then it's never dark, just the colour changes very quickly according to the desired colour temperature.
I can achieve the output inverting on AVR MCUs with a flag and it works very well. But I'm using an ESP32 for a bigger application with more channels.
As I've seen it, the LED controller sets up PWM signals on up to 8 output channels. All channels turn on at the beginning of the shared PWM period, so all simultaneously, and then turn off when their individual compare value has been reached in the internal timer.
Is there a way to turn on channels at different times, or compare values? Or at least invert the output so that a channel isn't on during the time from LOW to CMP, but from CMP to HIGH.
I'd like to distribute the channel on-times more evenly to even the load on the PSU and have a less flickering light. One of my main scenarios is a dual-white (CCT) lighting that combines cold and warm white with 2 channels. When the light is on at maximum single brightness (100% of one channel), it doesn't flicker at all. But if it's distributed over two colours, it starts flickering again. This can be avoided if both colours (channels) simply alternate instead of partially overlap. Then it's never dark, just the colour changes very quickly according to the desired colour temperature.
I can achieve the output inverting on AVR MCUs with a flag and it works very well. But I'm using an ESP32 for a bigger application with more channels.