This document describes a power LED driver solution
using the PIC12HV615 microcontroller (MCU). The
PIC12HV615 is an 8-pin MCU with many integrated
analog features. The LED driver circuit is a buck (step-
down) solution and the circuit presented here can
operate from most any input voltage source as long as
it exceeds the forward voltage of the LEDs to be driven.
A proportional-integral (PI) controller algorithm is used
to regulate the LED current to a constant value. The PI
controller is executed at a rate of 976 Hz, leaving plenty
of CPU time available for other tasks. Although this
sample rate would provide inadequate control
response for most power supply applications, it works
well for LED applications because the LED presents a
constant load to the power stage. Therefore, the
controller does not need to make frequent adjustments.
The LED current is sampled using a resistor in series
with the source of the MOSFET in the buck circuit and
amplified using a single op amp. The LED current is
sampled using one of the available ADC inputs on the
PIC12HV615. The Enhanced Capture Compare PWM
(ECCP) module of the MCU is used in PWM mode to
drive the buck circuit. Since the MCU has an internal
voltage regulator and 8 MHz oscillator, very few
external components are required to complete the
circuit. AN1138
A Digital Constant Current Power LED Driver
drive current for this type of LED would be 350 mA and
Author: Stephen Bowling a typical forward voltage would be 3.5V. Secondly, we
Microchip Technology Inc. will assume that the circuit input voltage is 12V.
The inductor value will be chosen to allow a maximum
current ripple of +/- 20%. The eye will not be able to
INTRODUCTION perceive this cur……