LED Dimming Engine: An 8-bit MCU-based solution for a Switched-Mode Dimmable LED driver Mark Pallones, Microchip Technology

Electronics Technical ArticlesSouth-East European INDUSTRIAL Мarket - issue 2/2018

Switched-mode dimmable LED drivers are known for their efficiency and precise control of LED current. They can also provide dimming functionality which allows the end user to create fantastic lighting effects while reducing their power consumption.

An 8-bit microcontroller (MCU) implementation can provide the necessary building blocks to create solutions that enable communications, customizations and intelligent control. Additionally, core independent peripheral integration provides significant flexibility versus that of pure analog or ASIC implementation and enables innovation that expands lighting product capabilities and provides product differentiation.

Features such as predictive failure and maintenance, energy monitoring, color and temperature maintenance and remote communications and control, are just some of the advanced capabilities that can make intelligent lighting solutions even more attractive.

Although LED drivers offer many advantages over previous lighting solutions, there are also challenges in their implementation. But fear not, by the end of this article you’ll learn how an 8-bit MCU can be used to alleviate design challenges and create high-performance switched-mode LED driving solutions with capabilities beyond that of traditional solutions.

An 8-bit microcontroller can be used to independently control up to four LED channels which is something most off-the-shelf LED driver controllers cannot provide. In Figure 1, the LED dimming engines can be created out of the peripherals available in the microcontroller.

Each of these engines has an independent closed channel that can control the switched-mode power converter with minimal to no central processing unit (CPU) intervention. This leaves the CPU free to perform other important tasks such as supervisory functions, communications or added intelligence in the system.

LED Dimming Engine

In Figure 2, the LED driver, which is based on the Current-Mode Boost converter, is controlled by the LED dimming engine. The engine is mainly composed of core independent peripherals (CIP) such as complementary output generator (COG), digital signal modulator (DSM), comparator, programmable ramp generator (PRG), op amp (OPA), and pulse-width modulator 3 (PWM3).

Combining these CIPs with other on-chip peripherals, such as fixed-voltage regulators (FVR), digital-to-analog converters (DAC) and Capture/Compare/PWM (CCP), completes the whole engine. The COG provided the high frequency switching pulse to MOSFET Q1 to allow the transfer of energy and supply current to the LED string.

The switching period of the COG output is set by the CCP and the duty cycle, which maintains the LED constant current and is dictated by the comparator output. The comparator produces an output pulse whenever the voltage across Rsense1 exceeds the output of PRG module. The PRG, whose input is derived from OPA output in the feedback circuit, is configured as a slope compensator to counteract the effect of inherent subharmonic oscillation when the duty cycle is greater than 50%.

The OPA module is implemented as an error amplifier (EA) with a Type II compensator configuration. The FVR is used as the DAC input to provide voltage reference to the OPA non-inverting input based on the LED constant current specification.

In order to achieve dimming, the PWM3 is used as a modulator of the CCPoutput while driving the MOSFET Q2 to rapidly cycle the LED ON and OFF. The modulation is made possible through the DSM module and the modulated output signal is fed to the COG. PWM3 provides pulse with variable duty cycle which controls the average current of the driver and in effect controls the brightness of the LED.

The LED dimming engine can not only accomplish what the typical LED driver controller does but it also has features that solve the typical problems that an LED driver poses. We’ll now walk through these problems and how a LED dimming engine can be used to avoid them.


Flickering is one of the challenges that typical switched-mode dimmable LED drivers may have. While flickering can be a fun effect when it’s intentional, when LEDs inadvertently flicker it can ruin the user’s desired lighting design.

In order to avoid flickering and provide a smooth dimming experience, the driver should perform the dimming step from 100% light output all the way down to its low-end light level with a continuously fluid effect. Since the LED responds instantaneously to current changes and doesn’t have a dampening effect, the driver must have enough dimming steps so the eye does not perceive the changes.

To meet this requirement, the LED dimming engine employs PWM3 for controlling the dimming of the LED. The PWM3 is a 16-bit resolution PWM that has 65 536 steps from 100% to 0% duty cycle, ensuring a smooth lighting-level transition.

LED Color Temperature Shifting

The LED driver can also shift the LED’s color temperature. Such color change can be noticeable to the consumer and weaken claims made about the high-quality lighting experience of LEDs. Figure 3 shows a typical PWM LED dimming waveform. When the LED is off, the LED current gradually diminishes due the slow discharge of the output capacitor. This event can lead to color temperature shifting and higher power dissipation of the LED.

The slow discharging of the output capacitor can be eliminated by using a load switch. For example, in Figure 2, the circuit used Q2 as a load switch andthe LED dimming engine synchronously turns off the COG PWM output and Q2 in order to cut the path of the decaying current and allow the LED to turn off quickly.

Current Peaking

When using a switched-mode power converter for driving the LED, the feedback circuit is employed to regulate the LED current. However, during dimming, the feedback circuit can create current peaking (see Figure 3) when the operation is not handled properly.

Looking back at Figure 2, when the LED is on, a current is delivered to the LED and the voltage across RSENSE2 is fed to the EA. When the LED turns off, no current is delivered to the LED and RSENSE2 voltage becomes zero. During this dimming off-time, EA output increases to its maximum and overcharges the EA compensation network.

When the modulated PWM turns on again, it takes several cycles before it recovers while high-peak current is driven to the LED. This current peaking scenario shortens the lifetime of the LED.

To avoid this problem, the LED dimming engine allows the PWM3 to be used as an override source of the OPA. When the PWM3 is low, the output of the EA is tristate which completely disconnects the compensation network from the feedback loop and holds the last point of the stable feedback as a charge stored in the compensation capacitor.

When the PWM3 is high and the LED turns on again, the compensator network reconnects and the EA output voltage immediately jumps to its previously stable state (before PWM3 is low) and restores the LED current set value almost instantly.

Complete Solution

As mentioned earlier, a LED dimming engine can operate with minimal to no CPU intervention. Therefore, while offloading all of the work for controlling the LED driver to the CIPs, the CPU has significant bandwidth to execute other important tasks.

Protection features, such as undervoltage lockout (UVLO), overvoltage lockout (OVLO) and output overvoltage protection (OOVP) can be executed by processing the sensed input and output voltage. This ensures that the LED driver is operating within desired specifications and the LED is protected from abnormal input and output conditions. The CPU can also process the thermal data from a sensor to implement a LED’s thermal management.

Moreover, when setting the dimming level of the LED driver, the CPU can process triggers from a simple external switch or command from a serial communication. Also, the parameters of LED driver can be sent to external devices through the serial communication for monitoring or testing.

Aside from the features mentioned above, the designer has the luxury to add more intelligence on their own LED application inclusive of communications, like DALI or DMX, and control customizations. Figure 4 shows an example of a complete switched-mode dimmable LED driver solution using the LED dimming engine.


A LED dimming engine can be used to create an effective switched-mode dimmable LED driver. The effectivity equates on its capabilities to drive multiple LED strings, to provide efficient energy source, to ensure LED’s optimal performance, to maintain a long life for the LEDs and to add intelligence in the system.