EVBUM2058DB - High Brightness LED SEPIC Driver Evaluation ...
AN1978 SEPIC LED Driver Demo Board for Automotive...
Transcript of AN1978 SEPIC LED Driver Demo Board for Automotive...
AN1978SEPIC LED Driver Demo Board for Automotive Applications
INTRODUCTIONThis application note describes a circuit developed asan LED driver solution for automotive applications. Theflexible control capabilities of Microchip’s PIC16F17698-bit microcontroller allow the LED driver to maintainconstant LED current, provide enhanced dimmingperformance, increase the lifespan of the LEDs, andadd safety features. The use of the Core Independent Peripherals (CIPs) ofthe PIC16F1769 permits the LED driver’s power train tooperate in a Fixed-Frequency Continuous Conductionmode and regulate the LED current using Peak Currentmode control.
The core independent and on-chip peripherals used inthis design are:• Complementary Output Generator (COG)• Comparator (CMP)• Programmable Ramp Generator (PRG)• Operational Amplifier (OPA)• Data Signal Modulator (DSM)• Fixed Voltage Reference (FVR)• Digital-to-Analog Converter (DAC)• Timers (TMR)• Pulse-Width Modulation (PWM)• Capture Compare PWM (CCP)• Analog-to-Digital Converter (ADC)These CIPs are combined with other on-chipperipherals to perform functions autonomously withminimal core intervention. They can alter systemperformance for faster response time, freeing the coreto perform other tasks. Because of the PIC®
microcontroller CIPs that control the SEPIC powertrain, the current regulation is completely automaticwith no software overhead and the protection featuresoperate its tasks independently.The solution described in this application note has thefollowing performance specifications and key features(see Table 1).
Key Features• Fully-Compensated High Bandwidth Peak Current
Control• PWM Dimming Control• Transient and Reversed Input Voltage Protection• Input Under- and Overvoltage Protection• Output Overvoltage Protection• Short-Circuit Protection• Overtemperature Protection
• Fault Output Indicator• Automatic BIN (Brightness Index Number)
Detection
Authors: Kristine Angelica Sumague Mark PallonesFranz ThalheimerMicrochip Technology Inc.
TABLE 1: PERFORMANCE SPECIFICATION Symbol Parameter Min. Typical Max.
VIN Operating Input Voltage Range 6V 30V 48V
VOUT LED String Voltage 3V 50V
ILED LED String Average Current 100 mA 350 mA 400 mA
h Efficiency at 12 VIN, Full dimming 82%
FSW Switching Frequency 350 kHz
VUVLO Input Undervoltage Lockout Threshold 6V — 7.5V
VOVLO Input Overvoltage Lockout Threshold 23V — 24V
VOOVP Output Overvoltage Protection Threshold 34V
LEDOTW LED Temperature Warning 90°C — 100°C
LEDOTP LED Temperature Protection 90°C — 124°C
2015-2020 Microchip Technology Inc. DS00001978C-page 1
AN1978
SEPIC CONVERTERThe LED driver’s power train used in this applicationnote is based on the Single-Ended Primary InductanceConverter (SEPIC). This hybrid DC/DC convertertopology is an attractive LED driver solution forautomotive applications because the SEPIC canprovide a regulated output voltage or current, even ifthe input supply voltage goes below or above theoutput voltage while providing a non-inverted outputreferring to the same ground potential as its input.When the automotive electrical supply voltage dropsbelow the LED’s voltage during cold crank, or risesabove the LED’s voltage during load dump, the SEPICcan maintain the LED current constant. Another advantage of the SEPIC in this application isits capability to handle sustained short-circuitconditions at its output, without power losses,component stress or overheating, as the couplingcapacitor Cc (Figure 1) quasi-isolates input and outputby default when the main switch Q5 is not operated.THEORY OF OPERATION
FIGURE 1: SEPIC LED DRIVER SIMPLIFIED SCHEMATIC
Figure 1 shows the simplified schematic of the LEDdriver. The whole circuit is controlled by thePIC16F1769 microcontroller, using its on-chipperipherals. The main function of the LED driver is tokeep the converter output current or the LED currentconstant, no matter how the automotive electricalsupply and the LED equivalent resistance varies. Theconstant current provided by the LED driver maintainsthe color temperature of the LED.
Q5
RSENSE1
INPUT VOLTAGE PROTECTION
INPUT FILTER
L1 CC D3
COUTL2
C5MCP1416
DC INPUT AN+
INPUT VOLTAGE SENSING
OUTPUT VOLTAGE SENSING
RSENSE2
VDD
Q3Q4 CAT-
C18R40 C18
C16
13 2 7
12
4 11 10
36
20
AN4
R24 Fault LED Indicator
14
TEMPERATURENTC
BRIGHTNESS INDEX NUMBER
EXTERNAL SIGNAL
8919
UART / LIN
AN9
AN3
COGQ
Autoshutdown
RS
FS
UART LINCS RX TX CCP2
DSMQCARH
CARLMOD
CCP1PWM5
DAC3CMP1
-
+
AN5CMP2
+
- PRG
OPA1+
-
DAC1
FVR
Tri-state
OUTPUT FILTER
R16
2015-2020 Microchip Technology Inc. DS00001978C-page 2
AN1978
Upon applying a positive DC voltage at the input of theLED driver to initiate the circuit start-up, the VDDvoltage of PIC16F1769 increases. (The setup for theLED driver demo board for proper operation isdiscussed in Section Appendix A: “GettingStarted”). When the VDD is high enough (usually theminimum VDD of the microcontroller) and the clockfrequency of the microcontroller is stabilized, the FVR,DACs, CMPs, COG, Timers, PWM, CCPs, OPA1, ADC,EUSART, PRG, and DSM peripherals are initializedand connected together. After the initialization, theOPA1 and the TMR2 are still disabled, and the PRGramp is not started. The firmware initializes the Faultprotection threshold values, the converter status andvalues, and the Binning class before enabling theOPA1, TMR2 and PRG ramp. Upon enabling theperipherals and the Fault thresholds are overcome,DSM and CMP2 provide an output that triggers therising and falling source of COG. The COG delivers aPWM signal which drives the input of the MCP1416MOSFET driver to turn On/Off Q5, repeatedly. SeeFigure 2 for the COG output timing during start-up.FIGURE 2: START-UP WAVEFORM
As mentioned earlier, the LED driver, which is based onthe SEPIC converter topology, operates in Continuous-Conduction mode. Just like other converter topologies,the SEPIC in Continuous Conduction mode assumestwo states per switching cycle at the Steady Statecondition. In the On state, the COG out is high and Q5is On; while in the Off state, the COG out is low and Q5is Off.During the On state, the input voltage charges theinductor L1 while the coupling capacitor CC charges L2.The output diode D3 is reverse-biased and COUT is leftto supply the load current. The voltage across the L1and L2 at this state are defined by Equation 1 andEquation 2, respectively.
EQUATION 1: VOLTAGE ACROSS L1 DURING ON STATE
EQUATION 2: VOLTAGE ACROSS L2 DURING ON STATE
During the Off state, VIN recharges CC. The energystored in L1 and L2 forces the current to flow throughD1 and through the output while replenishing COUT. Atthis state, Equation 3 and Equation 4 represent thevoltage across L1 and L2, respectively.
EQUATION 3: VOLTAGE ACROSS L1 DURING OFF STATE
EQUATION 4: VOLTAGE ACROSS L2 DURING OFF STATE
To reach the Steady State condition of a converter, thenet inductor voltage must be zero. Otherwise, theamplitude of the inductor’s current will continuouslyincrease until inductor saturation occurs. To ensure thezero average voltage across the inductor, the volt-second balance on the inductor must be satisfied.Figure 3 shows the volt-second balance on inductor L1and L2 where the area (volt-second) during On state isequal to the area during Off state. At this condition, thetotal area produced under the inductors’ voltage isequal to zero. The volt-second balance on L1 and L2can be represented also by Equation 5 and Equation 6,respectively.
VL1ON VIN=
VL2ON VCc=
VL1OFF VCC VOUT VIN–+=
VL2OFF VOUT=
2015-2020 Microchip Technology Inc. DS00001978C-page 3
AN1978
FIGURE 3: INDUCTOR VOLT-SECOND BALANCEEQUATION 5: L1 VOLT-SECOND BALANCE EQUATION
EQUATION 6: L2 VOLT-SECOND BALANCE EQUATION
Using Equation 5 and Equation 6, voltage across CC(VCC) can be solved (see Equation 7 and Equation 8).
EQUATION 7: VCC EQUATION BASED ON L1 VOLT-SECOND BALANCE
EQUATION 8: VCC EQUATION BASED ON L2 VOLT-SECOND BALANCE
Since VCC is the same during each two distinct timeintervals in one switching period, Equation 7 can beequated to Equation 8. As a result, the voltageconversion ratio of the SEPIC converter in Continuousmode can be obtained (see Equation 9).
EQUATION 9: VOLTAGE CONVERSION RELATIONSHIP
Since the LED is used as a load in this application, VOUTin Equation 9 is also a product of the LED current ILEDand the LED string total dynamic resistance RL.Replacing VOUT with this relationship and solving forILED, Equation 9 leads to Equation 10.
EQUATION 10: LED CURRENT
Equation 10 shows that ILED is a function of VIN, RL, andD. This result is important because it shows how theILED depends on VIN, RL and D, or how, conversely theD can be controlled based on VIN and RL in order tomaintain the ILED constant.
Note: D represents the duty ratio between on-time and off-time of the main switch Q5; Ts rep-resents the switching period.
VCc + VOUT -VIN
VL2 (t) t
VCc
VOUT
DTsVL1 (t) t
VIN
DTs
(1-D)Ts (1-D)Ts
VINDTs VCC VOUT VIN–+ x 1 D– Ts=
VCCDTs VOUTx 1 D– Ts=
VCcVIN VOUT 1 D– –
1 D– ---------------------------------------------------=
VCcVOUT 1 D–
D-----------------------------------=
Note: Equation 9 is true when using twoseparate inductors or even when using acoupled inductor in a SEPIC. Themagnetically coupling of the inductor doesnot modify the SEPIC’s voltageconversion ratio.
Note: The equations are approximations whichdo not reflect the real signal waveforms.
VOUTVIN
---------------- D1 D–-------------=
ILEDVIN D
RL 1 D– -------------------------=
2015-2020 Microchip Technology Inc. DS00001978C-page 4
AN1978
Controlling the value of D is made possible by adjustingthe duty cycle of the COG’s PWM output. The CCP1,which provides a fixed-frequency pulse, is modulatedby PWM5 through the DSM to implement an enhanceddimming technique in this LED driver design. Themodulated output signal from the DSM triggers therising edge of the COG’s PWM output while the outputof the comparator C2 triggers the falling edge of theCOG’s PWM output. Effectively, the DSM carrier input(CCP1) determines the Q5’s switching period and theoutput of C2 determines the Q5 switching duty cycle.The CCP1 switching period can be calculated usingEquation 11 and the output of C2 is set by the feedbackcircuit
EQUATION 11: Q5 SWITCHING PERIOD
FIGURE 4: FEEDBACK LOOP CIRCUIT
Figure 4 depicts the Type ll compensator networkfeedback circuit based on the Peak Current modecontrol technique. The feedback circuit is composed ofthe peak current control loop and the average currentcontrol loop. In the peak current control loop, currentsis translated to voltage by RSENSE1 and is applied to thenoninverting input of C2. Likewise, in the averagecurrent control loop, the LED current is translated tovoltage by RSENSE2 and used by OPA as a source of itsinverting input. The RSENSE2 voltage (VSENSE2) iscompared to a reference voltage provided by the FVR,which can be narrowed further by the DAC. Thisreference voltage is chosen based on the LEDconstant-current required. The difference betweenVSENSE2 and the reference voltage is amplified by anOPA error amplifier gain. This gain is set by the valueof the external compensation network which iscomposed of resistors R16 and R40, and capacitorsC21 and C23. The OPA error amplifier is enabled andtri-stated by the PWM5 to eliminate high-peak current
that occurs during LED dimming. To explain theimportance of tri-stating the OPA, a detailed discussionis provided in Section “PWM LED Dimming”.The amplified voltage error is compensated by adecaying ramp from PRG to avoid subharmonicoscillations when the duty cycle is near or above 50%.For more information about the PRG SlopeCompensation mode, refer to Technical Brief,“Programmable Ramp Generator” (DS90003140). Theslope compensated voltage is used by C2 as aninverting input. C2 compares the voltage acrossRSENSE1 from the peak current loop and the slopecompensated voltage from the average current loop.While the RSENSE1 voltage is less than the slopecompensated voltage, the C2 output remains high. Theduty cycle of the COG output increases because theCOG still does not detect a falling event. Once theRSENSE1 voltage reaches the slope compensatedvoltage, the C2 output goes low and the duty cycle ofthe COG output is terminated. This is how the feedback
TS PR2 1+ 4 TOSC TMR2 prescale value=
Where: PR2 is the limit value of the TMR2 counter TOSC is the inverse of the oscillator frequency (1/FOSC)
TMR2 prescale value is the timer multipler before TMR2 increment
PRG1 -
+C2
+
-
OPA1
DAC1
FVR
R40C21
C23
R16
RSENSE2
LED Current
Feedback
Peak CurrentFeedback Input
COG Falling Source
RSENSE1
PWM5
Tristate/override
2015-2020 Microchip Technology Inc. DS00001978C-page 5
AN1978
circuit determines the response to input voltage andoutput current changes to maintain the LED currentconstant. The inductor current signal is compared withthe amplified translated output current error. Tovisualize the control operation of the LED driver inmaintaining the LED current constant, a timing diagramis provided in Figure 5.
FIGURE 5: LED DRIVER TIMING DIAGRAM AT 50% DIMMING
FEEDBACK STABILITYThe implementation of the feedback circuit toautomatically adjust the duty cycle forms a closed-loopsystem. This closed-loop system requires an adequatebandwidth and stable operation under all specifiedoperating conditions. The values of the error amplifier’sexternal compensation network are selected to meetthese requirements.To verify the bandwidth and stable operation, the openloop gain/phase measurement in a closed-loop systemis usually performed to determine the phase and gainmargin. Figure 6 shows the LED driver’s phase andgain plot. (Refer to Appendix D: “BODE PlotMeasurement Setup” for the gain and phasemeasurement setup).
CCP1
OPA (OUT)
PWM5
DSM
PRG
C2 (OUT)
COG (OUT)
Q5 CURRENT
D1 CURRENT
2015-2020 Microchip Technology Inc. DS00001978C-page 6
AN1978
FIGURE 6: OPEN LOOP GAIN AND PHASE PLOT OF THE LED DRIVER AT 100% DIMMINGLED DRIVER PROTECTION FEATURE To protect the driver from failure caused by abnormalinput and output conditions, the following protectionfeatures are implemented in the design.
UNDERVOLTAGE LOCKOUT (UVLO)The LED driver is designed only for a specific minimuminput voltage threshold. Beyond this threshold voltage,proper operation of the LED driver is not guaranteed.To avoid operation of the LED driver outside thethreshold input voltage, the operating input voltagerange of the LED driver is specified in the firmware.The input voltage is monitored from the voltage acrossresistor R31. This voltage is sampled and converted bythe ADC and the conversion result is compared to theUVLO limit value set in the firmware. The UVLO is set to 6.0V with a hysteresis voltage bandof 1.5V. The hysteresis ensures that the LED driver willnot turn On and Off intermittently near the UVLOset-point. It also ensures a clean transition when thepeak-to-peak input voltage is beyond the anticipatednoise and ripple. When the input voltage goes below6.0V, the COG, PWM5, and CCP outputs terminate andFault detection activates. When the voltage inputincreases again, it needs to reach 7.5V to re-enable theLED driver.
OVERVOLTAGE LOCKOUT (OVLO)The OVLO detection method is very similar to theUVLO, except that the limit is set to the maximumoperating input voltage of the LED driver. The OVLOlimit is set to 24V with a hysteresis voltage band of 1V.When the input voltage exceeds the OVLO limit of 24V,the COG, PWM5, and CCP outputs terminate and Faultdetection activates. The LED driver will be re-enabledonce the input voltage becomes equal to or goes below23V. Just like the UVLO limit, OVLO limit can also be set inthe firmware. This is one of the advantages of using amicrocontroller in this application. Any limits can besimply changed in firmware, precluding the need forchange in the external components.
INPUT VOLTAGE PROTECTIONThe input voltage protection circuit is employed toprotect the LED driver from reverse polarity inputvoltage and high input transient voltage. Supplyingreverse polarity voltage usually occurs as a result of anaccidental swapping of ground and the positive railduring system installation. In the input voltageprotection circuit shown in Figure 7, when negativevoltage is supplied to the LED driver, the body diode ofthe P-MOSFET Q1 blocks the negative input voltageand Q1 is prohibited from conducting (see Figure 8).
2015-2020 Microchip Technology Inc. DS00001978C-page 7
AN1978
It would be easier and cheaper if a simple diode is usedfor the reverse polarity protection. However, duringnormal operation where a positive input voltage isapplied, the diode will dissipate too much power. Incomparison, using a P-MOSFET, the drain-sourcevoltage drop during conducting is much lower than thevoltage drop of a diode, thus reducing the powerdissipation. Aside from reverse polarity, the input protection circuitalso protects the LED driver from fast high-voltagetransients. This protection is achieved by employing abidirectional transient voltage suppressor diode D1across the input line and ground. The device operatesby shunting the excess current to the ground when apositive or negative applied voltage exceeds itsavalanche breakdown potential. As a result, thetransient energy is absorbed and is prevented frompassing through the LED driver circuit. The deviceautomatically resets when the overvoltage disappears.In a scenario where the input voltage is removed, thestored energy on the input filter capacitor needs to bedischarged to avoid the voltage of the capacitor feedsback to the input voltage source. This is made possibleby implementing a PNP transistor Q2.In normal operating condition, Q2 ceases the conduc-tion since its emitter voltage is less than the collectorand base voltage. Once the input voltage is removed,Q2 conducts and connect the Q1 source to ground.The stored energy on the input filter capacitor will nowbe discharged to resistors R2 without affecting theinput voltage source.FIGURE 7: INPUT VOLTAGE PROTECTION
FIGURE 8: -21.5V INPUT VOLTAGE
OUTPUT OVERVOLTAGE PROTECTION (OOVP)When the LED load is accidentally removed or one ofthe LEDs in the LED string fails open, the feedbackloop breaks and the output voltage rises abruptly.Excessive output voltage can cause faulty performanceor damage to the LED driver circuit. To protect the LEDdriver from this Fault event, OOVP is implemented. TheOOVP detection feature is implemented by comparingthe derived output voltage across R41 with the OOVPvoltage limit provided by the DAC3. When the voltageacross R41 reaches the voltage limit, the C1 triggersthe COG’s auto-shutdown feature that stops the PWMswitching. As Figure 9 shows, when the output voltagereaches the OOVP limit of approximately 34V, theCOG’s PWM output terminates and the Fault detectindicator is activated.
FIGURE 9: OOVP WAVEFORM
VIN C8 D1R3
R8
D2
Q1INPUT FILTER
Q2
R2
2015-2020 Microchip Technology Inc. DS00001978C-page 8
AN1978
SHORT-CIRCUIT PROTECTIONAs mentioned previously, the LED driver controloperates based on Peak Current mode control toregulate the LED current. Since the inductors’ currentis monitored and limited, cycle by cycle, when underPeak Current mode control, the LED driver hasinherent short-circuit protection.When the LED driver output or the LED string areshorted, the output draws excessive current. This largecurrent causes the inductors’ peak current to riseabruptly. The steep slope of the inductor current istranslated to a voltage by RSENSE1. When the voltageacross RSENSE1 reaches the slope compensated OPAerror voltage, the COG PWM output duty cycle alsodecreases causing an output current drop. This is howthe LED driver prevents an excessive increase ofoutput current during a short-circuit condition. TheCOG’s PWM output duty cycle remains at minimumpercentage as long as the short-circuit exists (seeFigure 10). The LED driver will return to normaloperation, once the short-circuit is removed.FIGURE 10: OCP WAVEFORM
OVERTEMPERATURE PROTECTIONBecause of the heat generated by the LEDs, the LEDdriver requires proper thermal management. This willincrease the LEDs’ lifespan and protect them frompotential damage due to excessive heat.In the LED driver circuit, an NTC thermistor isemployed to correctly monitor the LED casetemperature. This type of NTC thermistor exploits theresistance-versus-temperature characteristics of thethermistor. Its non-linear resistance change-overtemperature characteristic can be linearized byimplementing a look-up table in the firmware. Thethermistor voltage output is sampled and converted bythe ADC and the conversion result becomes the tableindex of the look-up table without any furthercalculation. Each index of the look-up table provides atemperature in °C for each value of the 10-bit ADC.
In Figure 11, as the LEDs continuously emit lights, theLED case temperature increases, while the LED drivermaintains the effective average LED current. When thetemperature reaches the overtemperature warning(OTW) trip point of 100°C, the LED driver alerts theuser through an indicator in the Graphical UserInterface (GUI). Once the temperature reaches thebreakpoint of 124°C, the COG, PWM5, and CCPoutputs terminate and Fault detection activates until theLED case temperature goes below the thermalbreakpoint of 90°C.Power de-rating can be an option for LED driverthermal management. This method can provide theLED driver the intelligence to trim down the initialeffective average LED current once the LED casetemperature reaches the breakpoint. When thetemperature goes below the thermal breakpoint, thereduced dimming ratio gradually increases until theeffective average LED current returns to its initial value.
2015-2020 Microchip Technology Inc. DS00001978C-page 9
AN1978
FIGURE 11: OVERTEMPERATURE DETECTION RESULTAUTOMATIC BIN DETECTIONLike all manufactured products, LEDs havemanufacturing process variations that lead to variationin their performance. These variations can bealleviated through a binning process. Binning is themanufacturers’ process that categorizes LEDsdepending on their color temperature output and lumenoutput. For this application, the type of LED used is ahigh-power LED with full white color temperature rangethat provides high brightness illumination. The on-board LEDs on this LED driver demo boardprovide a luminous flux between 71 and 140 lm at anominal current rating of 350 mA. The LEDmanufacturer categorizes luminous flux into fivebrightness classes as shown in Table 2. Since LEDsare current-controlled devices and the luminous flux ofan LED is directly proportional to the current, thedesired light output can be achieved by regulating thecurrent.
The binning class of the LED can be categorized usinga binning resistor. The voltage across the binningresistor is sampled and converted by the ADC. TheADC result determines the binning class of the LED.Once the binning class has been identified, thefirmware calculates the DAC value to set the LEDcurrent abruptly. With the use of the PICmicrocontroller, automatic binning detection can beeasily implemented.
PWM LED DIMMINGOne way of achieving LED dimming is by varying theLED forward current. However, this dimming methodcan cause the LED color temperature to change. Incomparison, LED dimming based on PWM keeps theforward current constant, which makes the colortemperature stable, while using a PWM signal torapidly cycle the LED On and Off. In a Basic-Switched mode PWM LED driver, as shownin Figure 12, the DC/DC converter transfers energy athigh-switching frequency to provide current to the LED.The DC/DC converter controller monitors the derivedvoltage across LED current sense resistor RSENSE2through the feedback circuit to increase or decreasethe duty cycle of the PWM output signal that drives theDC/DC converter switch. This linear change of thePWM duty cycle maintains the LED’s current at aconstant value. The dimming is achieved by turning thecontroller’s PWM output On and Off at much slowerthan its switching frequency. (A dimming signal thatturns the PWM output On and Off can be internal orexternal to the controller). This produces a frequency-modulated PWM output signal that turns the LED Onand Off. The perceived brightness of the LED isproportional to the modulated PWM duty cycle.
TABLE 2: LED BRIGHTNESS CLASSES
GroupLuminous Flux
v (lm)Luminous Intensity
Iv (cd)
KX 71 to 82 19KY 82 to 97 22KZ 97 to 112 26LX 112 to 130 30LY 130 to 140 35
2015-2020 Microchip Technology Inc. DS00001978C-page 10
AN1978
FIGURE 12: BASIC PWM LED DIMMING CIRCUITAlthough Figure 12 provides dimming control, there aretwo drawbacks that must be carefully considered whenusing this scheme. These drawbacks occurinstantaneously during the LEDs On/Off switching (seeFigure 13). The first drawback happens when the LEDis off. During this period, the LED output current isgradually diminishing due to the slow discharging of theoutput capacitor. This can lead to a change in colortemperature and higher dissipation of the LED. The second drawback lies in the driver’s feedbackcircuit. When the LED is on, a current is delivered to theLED and the voltage across RSENSE2 is fed to the erroramplifier (EA). When the LED turns off, no current flowsto the LED and the RSENSE2 voltage becomes zero.During this dimming off-time, EA output increases to itsmaximum and overcharges the EA compensationnetwork. When the modulated PWM turns on again, ittakes several cycles before it recovers while high-peakcurrent is driven to the LED. This current overshootoverdrives, and can shorten the lifetime of the LED.
+
-
OPAVREF RSENSE2
DC/DC Converter
DC Input
CIN
COUT
Feedback
PWMController
2015-2020 Microchip Technology Inc. DS00001978C-page 11
AN1978
FIGURE 13: BASIC PWM LED DIMMING WAVEFORMTo provide more visually attractive dimming and protectthe LEDS from overcurrent, an enhanced dimmingtechnique is employed in this LED driver design. Thistechnique involves firmware and additionalcomponents.
The effect of the slow discharging of the outputcapacitor is eliminated by adding a load switch Q4between the LED string and the sensing resistorRSENSE2 (see Figure 14). The COG output and Q4 aresynchronously turned off to cut the path of the decayingcurrent and allow the LED to turn off faster.
FIGURE 14: LED DIMMING CIRCUIT
On the other hand, the high-peak current that occursduring LED transition from Off to On can be eliminatedby using the override control of the OPA that activatesduring LED off time. The override control of the OPAcompletely disconnects the output of the OPA from theGPIOs in tri-state. In this manner, the compensationnetwork is completely disconnected from the feedbackloop and holds the last point of the stable feedback ascharge stored in the compensation capacitor. When theLED turns on again, the compensator network
reconnects and the OPA output voltage immediatelyjumps to the previous stable state (before the LED wasoff) and restores the LED current set value almostinstantly (see Figure 15).
RSENSE1
RSENSE2
Q4
R40 C18
C162 7 4 11 10
8919
UART / LIN
COGQ
Autoshutdown
RS
FS
UART LINCS RX TX
DSMQCARH
CARLMOD
CCP 1PWM5
CMP2+
-
PRG OPA1+
-
DAC1
FVR
Tr i-state
DC/DC Converter
VDD
Q3
LED
VOUT
ILED
Q4 ON Q4 OFF
LED FORWARDCURRENT
EFFECTIVE AVERAGE LED CURRENT
R16
2015-2020 Microchip Technology Inc. DS00001978C-page 12
AN1978
FIGURE 15: PWM DIMMING OPERATIONThe PWM signal that controls the switching of Q4 isPWM5. PWM5, running at 1 kHz frequency, switchesthe MOSFET driver Q3 to drive the gate of Q4 andturns the LED on and off. PWM5 also controls the stateof the OPA1 and the COG output. Effectively, the COGPWM output and OPA1 operation are disabled byPWM5. When the PWM5 output is high, the COG PWMoutput and OPA1 operation are enabled, and the gateof Q4 is pulled to VDD. This permits the LED driver tomaintain the output voltage and to switch on Q4. WhenQ4 is on, there is a current path between the LED andground, which allows current to flow, turning on theLED. When the PWM5 output goes low, the gate of Q4is pulled to ground to stop it from conducting. When Q4is Off, the LED is disconnected from ground and it turnsoff. Also, when PWM5 is low, the OPA output is tri-stated and DSM output becomes low. When the DSMoutput is low, the rising source of the COG will not betriggered, which keeps the COG output low (seeFigure 15). Keeping the COG output low when Q4 isOff avoids continuous increase of the voltage at theLED driver output that will eventually trigger the OOVP.The frequency of PWM5 is chosen in such a way thatthe human eye cannot perceive the flickering.Turning the LED On and Off produces an effectiveaverage LED current at the output of the LED driver.This effective average LED current can also be used asa representation of the LED brightness.
Therefore, when the duty cycle of the PWM5 outputchanges to control the brightness of the LED, theeffective average LED current also changes as shownin Figure 16.
FIGURE 16: PWM DIMMING
The effective average LED current can be variedlinearly in the GUI by increasing the dimming value upto 100%, (see Appendix C: “PIC16F1769 SEPIC LEDDriver Graphical User Interface”). Since the LEDcurrent determines the luminous flux of the LED, therelation between the dimming value and the luminousflux is practically linear, as shown in Figure 17.
FIGURE 17: DIMMING LINEAR FUNCTION
Effective Average LED current
50%
LED
Cur
rent
0%
I00%
Effective Average LED current
25%
LED
Cur
rent
0%
I00%
25% Brightness (PWM Dimming)
50% Brightness (PWM Dimming)
2015-2020 Microchip Technology Inc. DS00001978C-page 13
AN1978
However, the human eye does not perceive the rate ofchange as constant when the LED is dimmed linearlyover time. Because of this, an exponential dimmingapproach that applies the Weber-Fechner law can beselected in this LED driver (see Figure 18). Thisdimming approach approximates the logarithmicrelationship between luminous flux and perceivedbrightness that allows the human eye to perceive asmooth and gradual dimming.FIGURE 18: WEBER-FECHNER EXPONENTIAL DIMMING
To support the Weber-Fechner sensitivity scale in thefirmware, a look-up table with values of brightness lev-els along the exponential curve has been implemented.This look-up table translates the linear PWM dimmingduty ratios into non-linear ergonomic Weber-Fechnercharacteristics.
FIRMWARE FLOW
FIGURE 19: FIRMWARE FLOW
Figure 19 shows the flowchart of the LED driverfirmware. When the microcontroller clock frequency isstabilized, the firmware initializes the peripherals,including the interconnections between peripherals.Likewise, the I/O pins are configured, as required.When the peripherals and I/O pins are initialized, thefirmware executes the InitFaultHandler(),InitConverter() and GetBin() routines. The InitFaultHandler() routine sets up all of theprotection feature parameters while theInitConverter() routine sets up the dimming andthe protection feature monitoring of the LED driver.These protection feature parameters are summarizedin Appendix E: “SEPIC LED Driver ProtectionFeature Thresholds”.
while(1)
START
Configure oscillator, pins and peripherals
InitFaultHandler();InitConverter();
GetBin();
Enable interrupts
InitUARTsend();
Enable OPA1, PRG1 ramp and TMR2
task_RecUart();
task_SendUart();
task_CheckOutputVoltage();
task_CheckInputUnderVoltage();task_CheckInputOverVoltage();
task_SetDimmingDutyRatio();
task_RecUart();
FaultHandler();
task_CheckTemperatureWarning();task_CheckTemperatureProtection();
Case 1:
Switch TaskCounter
Case 2:
Case 3:
Case 4:
Case 5:
Case 6:
Case 7:
Case 8:
Task_Idle();Case 9:
Reset TaskCounter to ‘1’Case 10:
Wait until task time (100 us) is over
2015-2020 Microchip Technology Inc. DS00001978C-page 14
AN1978
The GetBin() routine measures the Brightness IndexNumber (BIN) resistor and sets the associated forwardcurrent of the LED driver. The firmware will then enableinterrupts and execute the InitUARTsend(). TheInitUARTsend() routine initializes the transmissionof the data that is used in the GUI. When this routinehas been executed, the firmware performs thefollowing: enable OPA1, start the PRG ramp generationand starts the increment of TMR2 register. This eventenables the operation of the LED driver.At this stage, the LED driver is running in normaloperation with the initial dimming setting while thefirmware is in a continuous loop executing the followingtasks depending on the value of the TaskCounter.Each tasks is executed every 100 µs.1. task_RecUart() routine: This routinereceives the data selected by the user in theGUI. The parameters that the user selected forthe nominal LED current, the dimming percentand the dimming mode will be adapted by thefirmware.
2. task_SendUart() routine: This routine sendsto the GUI the information about the LED driverthat can be viewed by the user every 10 ms.
3. task_CheckOutputVoltage() routine: Thisroutine checks the output voltage of the LEDdriver. When the output voltage exceeds thepredefined maximum output voltage, the OVPwill be triggered.
4. task_CheckInputUnderVoltage() andtask_CheckInputOverVoltage() routines:These routines check the input voltage of theLED driver. When the input voltage goes belowor above the specified thresholds, the UVLO orOVLO will be triggered, respectively.
5. task_SetDimmingDutyRatio() routine:This routine sets the dimming of the LEDaccording the parameters selected by the userin the GUI.
6. FaultHandler()routine: This routine disablesor recovers the LED driver based on definedFault conditions. The LED driver will be disabledwhen any of the protection features has beentriggered. Likewise, the LED driver will recoverfrom Fault detection when conditions havereturned to the specification range.
7. task_CheckTemperatureWarning() andtask_CheckTemperatureProtection()routine: These routines check the LED casetemperature. When the temperature rises up tothe predefined thresholds, the OTW or OTP willbe triggered, respectively.
8. Idle() routine: This routine serves as a delayto achieve 1 ms execution of all the tasks.
9. After the execution of the function routines, thefirmware sets the TaskCount to ‘1’. This eventlets the firmware execute all of the functionroutines again, forming a continuous loopexecution.
Notice that after initialization, no code is written forregulating the output current. This is because the CIPs,which have been combined to control the power train,do not require input from the CPU and perform the taskindependently. As a result, the complexity of thefirmware is reduced.
COMPONENT SELECTIONSThis section describes the considerations on how theLED driver’s major components are selected.
Peripheral Configuration for SEPIC LED Driver using MCC SMPS Library
The SEPIC LED Driver incorporates the PIC16F1769 as a freely programmable power supply management integrated circuit that can be programmed with the code generated using the MPLAB® Code Configurator (MCC) Switched Mode Power Supply (SMPS) Library. The MCC SMPS Library allows quick and easy configuration, and code generation for 8-bit PIC MCU SMPS applications. This library contains a set of modules for generic fundamental SMPS building blocks and topologies. For more information about the MCC SMPS Libraryand the step by step procedure on how to configure itto run the SEPIC LED Driver, refer to ‘MPLAB CodeConfigurator Switch Mode Power Supply Library User'sGuide’ (DS50002835) and “MCC SMPS Library Con-figuration for SEPIC LED Driver Demo Board”(DS00003343), respectively.
Duty CycleSelecting a proper value and rating of componentsbegins with determining the maximum duty cycle DMAXof the PWM output. The determination of DMAX allowsthe calculation of component current ratings and themaximum voltage stress on the switching elements.DMAX depends upon the minimum value of the inputvoltage VIN and the voltage output, as determined bythe desired number of LEDs. Considering theseconditions in the voltage conversion relationshipdefined in Equation 7, DMAX can be calculated asfollows (see Equation 12).
Note: The source code of this application note isavailable from the Microchip website(www.microchip.com).
2015-2020 Microchip Technology Inc. DS00001978C-page 15
AN1978
EQUATION 12: MAXIMUM DUTY CYCLESo far, the diode D3 forward voltage drop VD has beenignored because of its low value. If the voltage drop ofthe diode is considered, DMAX will be (see Equation 13):
EQUATION 13: MAXIMUM DUTY CYCLE WITH D3 DIODE VOLTAGE DROP
Based on the given minimum input voltage and themaximum output voltage specification of the LEDdriver, the calculated DMAX is 82%. The COG in themicrocontroller can provide much more than thisrequired duty cycle.
INDUCTOR L1 AND L2Solving VOUT in Equation 7 and substituting its result inEquation 8 to solve VCC shows that VCC is equal to VINthroughout the switching cycle. As discussedpreviously, the voltage applied to L1 is equal to VIN andthe voltage applied to L2 is equal to VCC. Since VCC isalso equal to VIN, therefore, the voltage applied for L1and L2 are both equal to VIN. Applying the same voltageto L1 and L2 allows these inductors to wind on thesame core. These coupled inductors take up lessspace on the Printed Circuit Board (PCB), reduce cost,and lower the inductor ripple current.Selecting the inductance value for the coupledinductors begins with calculating the inductor’s peak-to-peak ripple current. As a rule, a good approximation ofthe inductor’s ripple current is from 20% to 40% of themaximum input current. Too much ripple increases theElectromagnetic Interference (EMI) and too little rippleresults in unstable switching operation. Equation 14shows how to calculate the inductor ripple current bychoosing 20% of the maximum input current.
EQUATION 14: INDUCTOR RIPPLE CURRENT
Once the coupled inductor ripple current is determined,the inductance of coupled inductors can be calculatedusing Equation 15. Because the two windings ofcoupled inductors share the ripple current, regardlessof the desired inductor peak-to-peak ripple current, thevalue of the inductance will be half of the individualinductors.
EQUATION 15: COUPLED INDUCTOR VALUE
In this design solution, the calculated coupled inductorsvalue is equal to 22.49 uH. However, 22 uH is chosensince it is the nearest standard inductance valueavailable off-the-shelf from the manufacturer. Becauseof this, the inductor ripple current should be calculatedagain based on this chosen inductance value in orderto know the actual worst-case inductor ripple current(see Equation 16).
EQUATION 16: ACTUAL COUPLED INDUCTOR RIPPLE CURRENT
DMAXVOUT
VIN MIN VOUT+-----------------------------------------------=
DMAXVOUT VD+
VIN MIN VOUT VD+ +---------------------------------------------------------------=
IL 0.2 ILEDDMAX
1 DMAX–--------------------------=
L L1,L2 12---
VIN MIN DMAX
IL FSW------------------------------------------------= =
IL ACTUAL12---
VIN DMAX
LACTUAL FSW---------------------------------------------=
2015-2020 Microchip Technology Inc. DS00001978C-page 16
AN1978
Another important inductor specification that must beconsidered is the maximum inductor peak current. Thechosen coupled inductors must have at least a 20%higher-peak current rating than this maximum inductorpeak current, in order to avoid saturation. Themaximum peak inductor current is determined by theL1 average current (IL1 AVE) and the L2 average current(IL2 AVE). Due to the isolation provided by the couplingcapacitor, IL1 AVE and IL2 AVE are equal to the inputaverage current and the LED forward current,respectively (see Equation 17). Combining these twocurrents plus half of the actual inductor ripple current,the worst peak inductor current can be calculated (seeEquation 18).EQUATION 17: AVERAGE L1 AND L2 CURRENT
EQUATION 18: INDUCTOR PEAK CURRENT
MOSFET Q5In selecting a power switch, a MOSFET with acapability to withstand peak voltage and current stress,while minimizing the power dissipation must beconsidered. The MOSFET must have a drain-currentrating higher than the current shown in Equation 18and a drain-source voltage rating higher than thevoltage shown in Equation 19. In addition, theMOSFET must have a power dissipation rating greaterthan the sum of conductive losses and switching lossesshown in Equation 20.
EQUATION 19: Q5 DRAIN-SOURCE VOLTAGE
EQUATION 20: Q5 POWER DISSIPATION
Based on the calculated value by using Equation 18,Equation 19, and Equation 20, the N-ChannelMOSFET with 60V, 8.7A and 800 mW at 70°C powerdissipation rating is used in the design.
OUTPUT DIODE D3Because the same peak current flows throughMOSFET Q5 and Diode D3, the selected D3 must alsohandle ILPK, as shown in Equation 18. Also, the reversevoltage rating of D3 should be greater than Q5’smaximum voltage to account for transients and ringing.Since the average D3 current is the forward LEDcurrent, D3 must be capable of handling the powerdissipation shown in Equation 21.
EQUATION 21: D3 POWER DISSIPATION
In this design, a Schottky barrier diode with a reversevoltage of 60V, a forward current of 1A, and a powerrating of 550 mW are used.
INPUT CAPACITOR CIN
The input capacitor CIN reduces the input ripplevoltage. CIN can have any value between 10 uF to 100uF since it sees fairly low-ripple current due to the inputinductor. In addition, since the current waveform is
IL1AVEVOUT ILED
VIN MIN -------------------------------------= efficiency=
IL2AVE ILED=
ILPK IL1AVE IL2AVE 0.5 IL ACTUAL + +=
VQ5DS VIN MAX VOUT MAX VD+ +=
Where:
RDS ON = drain-source on-state resistanceTR = Rise timeTF = Fall time
IQ5RMSIIN
DMAX-------------------------=
IQ5D drain current=
PQ5D IQ5RMS rDSON DMAX IQ5D VIN MIN VOUT VD+ + TRISE TFALL+
2------------------------------------------ FSW=
PD3D ILED VD=
2015-2020 Microchip Technology Inc. DS00001978C-page 17
AN1978
continuous and triangular, CIN should be able to handlethe RMS current that flows through it. The RMS currentflowing through CIN is given by Equation 22.EQUATION 22: INPUT CAPACITOR CURRENT
A 10 uF ceramic capacitor with 50V rating is used in theapplication due to its low-equivalent series resistanceand high RMS current capability.
COUPLING CAPACITOR CC
As mentioned previously, the voltage across couplingcapacitor CC is equal to VIN, therefore, CC must beselected with a voltage rating greater than themaximum input voltage specification. The capacitancevalue of CC can be calculated using Equation 23 whereVCS is the desired ripple voltage across CC.
EQUATION 23: COUPLING CAPACITOR
CC must be able to withstand the RMS current flowingthrough it. Therefore, the selected CC must have agreater RMS rating than a value calculated usingEquation 24.
EQUATION 24: ICC RMS CURRENT
OUTPUT CAPACITOR COUT
The output capacitor COUT supplies the output currentwhen Q5 is turned on, therefore COUT must haveenough capacitance while maintaining the application’srequirement for the output ripple voltage. Since theLED driver is using a low-ESR ceramic capacitor forCOUT, ESR can be ignored in calculating COUT. COUT canbe calculated using Equation 25, where the COUT ripplevoltage VCOUT is 1% of the maximum output voltage.
EQUATION 25: OUTPUT CAPACITOR
Similar to other capacitors in the circuit, the selectedoutput capacitor COUT must also be capable of handlingthe RMS current that enters and leaves through it. Theselected COUT RMS current rating must be greater thanthe computed RMS current expressed in Equation 26.
EQUATION 26: OUTPUT CAPACITOR CURRENT
Table 3 shows the summary of the selectedcomponents based on the computed values for thisapplication.
ICIN RMSILACTUAL
12----------------------------------=
CCILED DMAX
VCS FS--------------------------------------=
ICC RMS ILEDVOUT
VIN MIN------------------------=
COUTILED DMAX
VCOUT FSW-------------------------------------------
ICOUT RMS ILEDVOUT
VIN MIN------------------------=
TABLE 3: SEPIC DESIGN COMPONENT SELECTIONDesign
Equation Computation Selected Component/Rating
Passive Components
2015-2020 Microchip Technology Inc. DS00001978C-page 18
AN1978
(19)
COILCRAFT MSD1583-223MEB: 22 uH, 2.44A,65 mA
(20)
(21)
(22)
(24)
(28) 10 µF, 50V X7R ceramic
(29)
2 µF, 50V X7R ceramic
(30)
TABLE 3: SEPIC DESIGN COMPONENT SELECTION (CONTINUED)Design
Equation Computation Selected Component/Rating
DMAX31.2V 0.7V+
7V 31.2V 0.7V+ +----------------------------------------------- 82%= =
IL 0.2 350mA 0.821 0.82–------------------- 319 mA= =
L1 L2 12--- 7V 0.82
319 mA 400KHz----------------------------------------------- 22.494 H= =
IL ACTUAL7V 0.82
22 H 400 KHz---------------------------------------------- 652 mA= =
ILPK 1.95A 350mA 0.5 319mA + + 2.63A= =
ICINRMS650mA
12----------------- 188 mA= =
CC350 mA 0.82
312 mV 400 KHz------------------------------------------------- 2.05 F= =
ICC RMS 350 mA 31.2V7V-------------- 739 mA= =
2015-2020 Microchip Technology Inc. DS00001978C-page 19
AN1978
MCU PERIPHERALSFigure 20 and Table 4 summarize the configuration of the PIC16F1769 for this application.
FIGURE 20: PIC16F1769 PERIPHERAL CONFIGURATION
(31)
4.4 µF, 100V X7S ceramic
(32)
Active Components
(25)
SIR878ADP with 100V drain source voltage, 13.3A drain current, and maximum power dissipation of 3.2W at 70°C
(24)
(26)
(25)SS2PH10-M3/84A Schottky Barrier Rectifier with 100V reverse voltage, and 2A rectified forward current
(23)
(27)
TABLE 3: SEPIC DESIGN COMPONENT SELECTION (CONTINUED)Design
Equation Computation Selected Component/Rating
COUT350 mA 0.82
312 mV 400 KHz------------------------------------------------- 2.29 F=
ICOUT RMS 350 mA 31.2V7V
-------------- 739 mA= =
VQ5DS 21.5V 31.2V 0.7V+ + 53.4V= =
IQ5D 1.95V 350 mA 0.5 650mA + + 2.63A= =
PQ5D 1.725A 2 0.036 0.82 2.63A 7V 31.2V 0.7V+ + 1=
20 ns 20 ns+2----------------------------------- 400 KHz 71.83 mW=
VD3R 21.5V 31.2V 0.7V+ + 53.4V= =
ID3AVE 350 mA=
PD3D 350 mA 0.7V 245 mW= =
13 2 7
12
4 11 10
36
20
AN4
148919
AN9
AN3
COGQ
Autoshutdown
RS
FS
UART LINCS RX TX CCP2
DSMQCARH
CARLMOD
CCP1PWM5
DAC3CMP1
-
+
AN5
CMP2+
- PRG
OPA1+
-
DAC1
FVR
Tri-state
1 17
VPP VSS RA2RB6RB5RA5
RC0 RC5 RB7 RC3 RC2 RB4
RC4
RC7
15
RA116
RA018
VDD
2015-2020 Microchip Technology Inc. DS00001978C-page 20
AN1978
TABLE 4: PIC16F1769 PIN CONNECTIONPin
Number Name Function Circuit Connection
1 VPP VPP
2 RC5 COG Output SEPIC MOSFET Driver3 RC4 Fault Indicator LED Fault Indicator4 RC3 PWM5 Dimming Circuit5 RC6 Unimplemented6 RC7 Analog-to-Digital (AN9) LED Case Temperature 7 RB7 Comparator 2 Positive Input SEPIC Sensing Resistor (RSENSE1)8 RB6 UART Transmit9 RB5 UART Receive
10 RB4 OP AMP 1 Negative Input LED Sensing Resistor (RSENSE2)11 RC2 OPAMP1 Output Compensator Circuit12 RC1 Comparator 1 Negative Input Output Voltage Sensing13 RC0 Analog-to-Digital (AN4) Input Voltage Sensing14 RA2 Capture Compare PWM (CCP2) Automotive External Interface15 RA1 CLK16 RA0 DAT17 VSS Ground18 VDD Supply Voltage19 RA5 CS 20 RA4 Analog-to-Digital (AN4)
Note 1: Refer to Appendix F: “Peripheral References” for the list of technical briefs and references related to the peripherals used in this application.
2015-2020 Microchip Technology Inc. DS00001978C-page 21
AN1978
PERFORMANCEFigure 21, Figure 22 and Figure 23 show the dimmingperformance and efficiency of the LED driver.FIGURE 21: DIMMING PERFORMANCE
FIGURE 22: WEBER-FECHNER DIMMING PERFORMANCE
0102030405060708090100
03570
105140175210245280315350
0 10 20 30 40 50 60 70 80 90 100
Dut
y C
ycle
(%)
Effe
ctiv
e Av
erag
e C
urre
nt (m
A)
Dimming (%)
Linear Dimming Performance
Iout(mA) Duty Cycle (%)
0102030405060708090100
03570
105140175210245280315350
0 10 20 30 40 50 60 70 80 90 100Dimming (%)
Dut
y C
ycle
(%)
Effe
ctiv
e Av
erag
e C
urre
nt (m
A)
Weber-Fechner Dimming Performance
Iout(mA) DC (%)
2015-2020 Microchip Technology Inc. DS00001978C-page 22
AN1978
FIGURE 23: LED DRIVER EFFICIENCYCONCLUSIONIn a harsh usage environment, such as an automotiveapplication, an intelligent and reliable LED driver isessential. This application note describes an LEDdriver solution that meets this demand. By utilizing theflexibility of the PIC16F1769 microcontroller, an LEDdriver can maintain the consistency of the LED colortemperature, increase the LED’s lifespan, enhance thedimming method, and impose several safety features.
0102030405060708090
100
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Effic
ienc
y (%
)
Voltage Input (V)
LED Driver Efficiency
2015-2020 Microchip Technology Inc. DS00001978C-page 23
AN1978
APPENDIX A: GETTING STARTEDFIGURE A-1: ACTUAL PIC16F1769 SEPIC LED DRIVER
TABLE A-1: CONNECTOR DESCRIPTION Number Name Description
1 J5 Debugger/Programmer Interface2 SW1 Reset Button3 USB USB to UART Interface for GUI4 J7 Terminal for Binning and NTC5 J4 Terminal for On Board LEDs6 LIN LIN Connector Support7 J1 External Binning and NTC Support8 J2 External LED Support9 J3 Jumpers for On Board LED Selection
10 POWER Power Supply ConnectorNote 1: The schematic for this board can be found in Appendix F: “Peripheral References”
2015-2020 Microchip Technology Inc. DS00001978C-page 24
AN1978
Powering the PIC16F1769 SEPIC LED DriverApply the input voltage to the input terminal block, J1.The input voltage source should be limited to the 0V to+45V range at 1A current limit. For nominal operation,the input voltage should be between +7V and +23V.Applying Load to the PIC16F1769 SEPIC LED DriverThe LED driver has up to 12 on-board LEDs that canbe selected in J3 connector. A jumper must be placedto the desired number of LEDs. To drive external LEDs, connect the cathode side of theLED(-) to -Cat of J2, and the anode side of the LED(+)to +An of J2. Make sure that the jumper LED_ON isopen.
Status LEDThe PIC16F1769 LED driver has an LED to indicate theoccurrence of Fault detection during operation. Theturning On of the LED indicator states the followingfaults:• UVLO detection• OVLO detection• OOVP detection
Graphical User InterfaceA Graphical User Interface has been provided to theuser for the selection of the desired current, dimmingmethod, and dimming percentage. A display for Faultprotection, current temperature, input, and output volt-age is also provided. Refer to Appendix C:“PIC16F1769 SEPIC LED Driver Graphical UserInterface”.
BODE PLOT MEASUREMENTA bode connector is provided for power supplyfeedback loop measurement. Refer to the AppendixD: “BODE Plot Measurement Setup”.
PROGRAMMINGHeader J5 is provided for In-Circuit SerialProgramming™. Use MPLAB® X IDE to program theLED driver. Refer to the “MPLAB X IDE User’s Guide”(DS50002027) for more information on how to useMPLAB X IDE with a Microchip debugger/programmer.
Note: Disconnect the programmer beforeenabling the LED driver demo boardoperation (www.microchip.com).
2015-2020 Microchip Technology Inc. DS00001978C-page 25
AN1978
APPENDIX B: APPENDIX B: SEPIC LED DRIVER WITH FOUR ON-BOARD LEDSDEMO BOARD
FIGURE B-1: ACTUAL PIC16F1769 SEPIC LED DRIVER WITH FOUR ON-BOARD LEDS
TABLE B-1: CONNECTOR DESCRIPTIONNumber Name Description
1 CON1 Power Supply Connector2 CON2 Communication Connector Support3 CON3 External LED Support4 CON4 USB to UART Interface for GUI5 CON5 Terminal for Binning and NTC6 CON6 Debugger/Programmer Interface7 J1 Jumpers for On-Board LED selection8 LED Four LEDs
Note 1: The schematic for this board can be found in Appendix H: “SIMPLIFIED SCHEMATIC OF THE SEPIC LED DRIVER WITH FOUR ON-BOARD LEDs”
2015-2020 Microchip Technology Inc. DS00001978C-page 26
AN1978
APPENDIX C: PIC16F1769 SEPIC LED DRIVER GRAPHICAL USER INTERFACEFIGURE C-1: LED DRIVER GUI
This LED driver GUI is a PC utility designed to visualizethe real-time LED driver status, voltages, and tempera-ture. The dimming and the LED current of the LED canalso be controlled in the GUI.In order to use the LED driver GUI, a Mini-USB cable isneeded to establish the connection between the PCand the LED driver board. The LED driver board mustbe powered on before running the GUI. On the GUI,select the correct terminal port used and click the ‘INITUART’ button to initiate the communication.
2015-2020 Microchip Technology Inc. DS00001978C-page 27
AN1978
APPENDIX D: BODE PLOT MEASUREMENT SETUPFIGURE D-1: PLANT MEASUREMENT
FIGURE D-2: COMPENSATION MEASUREMENT
2015-2020 Microchip Technology Inc. DS00001978C-page 28
AN1978
FIGURE D-3: OPEN LOOP MEASUREMENT2015-2020 Microchip Technology Inc. DS00001978C-page 29
AN1978
FIGURE D-4: BODE MEASUREMENT RESULT2015-2020 Microchip Technology Inc. DS00001978C-page 30
AN1978
APPENDIX E: SEPIC LED DRIVER PROTECTION FEATURE THRESHOLDSTABLE E-1: PROTECTION FEATURE FIRMWARE THRESHOLDSConstant Variable Value Description
OutputVoltageClamping 50 Desired Output Overvoltage Clamping in VOutputVoltageClampRecovery 48 Desired Output Overvoltage Clamping Recovery Threshold in VInputUVLOTrip 6 Desired Input Undervoltage Lockout Threshold in VInputUVLORecovery 7.5 Desired Input Undervoltage Lockout Recovery Threshold in VInputOVLOTrip 24 Desired Input Overvoltage Lockout Threshold in VInputOVLORecovery 23 Desired Input Overvoltage Lockout Recovery Threshold in VLED_OTWTrip 100 Desired Overtemperature Warning Threshold in °CLED_OTWRecovery 90 Desired Overtemperature Warning Recovery Threshold in °CLED_OTPTrip 124 Desired Overtemperature Protection Threshold in °CLED_OTPRecovery 90 Desired Overtemperature Protection Recovery Threshold in °C
2015-2020 Microchip Technology Inc. DS00001978C-page 31
AN1978
APPENDIX F: PERIPHERAL REFERENCESTABLE F-1: SUMMARY OF PERIPHERALS REFERENCESPeripherals References
Analog-to-Digital Conversion Application Note AN840, PIC16F7X/PIC16C7X Peripherals Configuration and Integration (DS00008400)
Capture/Compare/PWM Application Note AN594, Using the CCP Module(s) (DS00594)Timer1 Technical Brief TB3100, Timer1 Timer Mode Interrupt Latency (DS90003100)Complementary Output Generator Technical Brief TB3119, Complementary Output Generator Technical Brief
(DS90003119) Slope Compensation Technical Brief TB3120, Slope Compensator on PIC® Microcontrollers
(DS90003120)Fixed Voltage Reference Technical Brief TB3104, Boost Converter Using the PIC16F753 Analog
Features (DS90003104)Operational Amplifier Technical Brief TB3132, Operational Amplifier Module of 8-bit PIC®
Microcontrollers (DS90003132)Comparators Application Note AN1104, Capacitive Multibutton Configurations (DS01104)Digital-to-Analog Conversion Application Note AN823, Analog Design in a Digital World Using Mixed Signal
Controllers (DS00823)
2015-2020 Microchip Technology Inc. DS00001978C-page 32
AN
1978
DS00001978C
-page 33
2015-2020 Microchip Technology Inc.
+5V
SMAJ30CAD1
231
Power Jack 2.5mm
J1
Vbat=6V...30V (48Vpk)
D
PGND
8
2.2uF50V
C8 0.1uF50V
C4
LIN_TXD
CS/LWAKELIN_RXD
ND
270pF50VDNPC29
DGND DGND
LIN BUS MODUL
TP15
PGND
An +Cat-PGND
21
3 BUK98180-100A
Q41000pF100V1206
C18
PGND
0.1uF16V
C13
PGND
33R06031%
R12
1k
R11TE_SINK
TP4
+5V
0R50012061%
R180R50012061%
R19
PGND PGND
4.7R06031%
R17
5019TP6
SINK
47pF50V0603
C19
DGND
Cat -
1123
J4
1123J2
1
2
3 4
5
6
PMD2001D
Q3
in
LIN
LIN
0.1uF50V
C9
5019TP14
TP19
TP20
Vbat
DNPD8
PGNDLIN
RXD 1EN 2
NRES 3
TXD 4
GND5 LIN 6
VS7
VCC8
ATA663254
U4 0R00DNPR36
0R00DNPR38
10k0R34
PGND
PGND
100nFC27
APPENDIX G: SCHEMATIC OF THE LED DRIVERFIGURE G-1: BOARD SCHEMATIC
2.2uF100V1210
C16
1 4
2 3SW_TACT SMD
SW1
12
34
56
Programming Adapter
J5
DGND
DGND
DGND
MSD1583-223MEB22 μH
3
2 1
4
L1L2
L2
L1
1.40 μH
DGND
PGND
DGND
DGND
+5V
+5V
+5V
+5V
1kR42
REDLD1
+5V
1k
R20
PGND
PGND
PGN
PGND
10uF50V
C7
PGND
47pFC20
1uF50V
C15
1uF50V
C14
PGND PGND
1R
R1
VoutVout=45V_max @ 15Wmax
Vout
DGND
0.22RR21
0R0603
R24
PGNDDGNDDGND
DGND
Vin
Vin
1000pFC22
1000pFC26
dnpTP11TP10
TP3
TP5
TP1
82k06031%
R37
0R
R13
10kR49
10kR15
10kR14
2.20k06031%
R40
47kR45
+5V
PGND
PGND
PGND
1RR5
1RR6
PGND
Use R39 for test purpose only
TP12
100kR2
4.7k
R3 41,2
,3
5,6,7,8
ZXM66P03N8Q1
1
23
BAT54SLT1
D7
100RR50
0.1uF16V
C30
DGND DGND
DGND
Binning (B)
PGND
TP10RR7
10uF50V
C110uF50V
C210uF50V
C3
10uF50V
C510uF50V
C6
DGND (G)
2.2uF100V1210
C17
DG
DGND
DGND
GATE_SINK
CS/LWAKE
LIN_TXDLIN_RXD
0.01uF16V0603
C31
DGND
1
23
BAT54SLT1
D10
DGND
+5V
10kR51
100R
R52
+5VNTC (N)
EXT_INT (E)
4k7R53
100R54
+5V
DGND
2 3
1 4
HCPL-181
U5
EXT_INT
EXT_INT
MMBT2907A
12
3
Q2
8.2VD2
10kR8
4
1,2,3
5,6,7,8SIR878ADP
Q5
0.22RR22
0.22RR23
VDD18
RA5/T1CKI/T2CKI/SOSCI/CLCIN3/DSM12MOD/OSC1/CLKIN 19RA4/AN3/T1G/SOSCO/DSM12CL/OSC2/CLKOUT 20RA3/T6CKI/DSM12CH/MCLR/VPP 1
RC5/RG1F/RG2F/T3CKI/CCP1 2RC4/RG1R/RG2R/T3G/CLCIN1 3RC3/AN7/OPA2OUT/ OPA1IN1-/OPA1IN1+/C1234IN3-/RG2IN0/RG1IN1/T5G/CLCIN0 4
RC6/AN8/OPA2IN0-/SS 5RC7/AN9/OPA2IN0+ 6
RB7/C2IN1-/C4IN1+/CK 7RB6/C1IN1+/C3IN1+/SCL/SCK 8RB5/AN11/OPA1IN0+/RX 9RB4/AN10/OPA1IN0-/SDI/SDA 10
RC2/AN6/OPA1OUT/OPA2IN1-/OPA2IN1+/C1IN2-/C2IN2-/RG1IN0/RG2IN1 11RC1/AN5/C1234IN1-/T4CKI/CLCIN2 12RC0/AN4/C2IN0-/C4IN0+/T5CKI 13
RA2/AN2/ZCD/T0CKI/COG12IN/INT 14RA1/AN1/VREF+/DAC1234REF+/C1234IN0-/ICSPCLK 15RA0/AN0/Vref-/DAC1234REF-/DAC1234OUT1/C1IN0+/C3IN0+/ICSPDAT 16
VSS17
PIC16F1769-E/ML
U3
4.7R06031%
R39
PGND PGND
GA
CS_SINK
CS_
Cat -
DGND
DGND
LIN_RXDLIN_TXD
VDD16GP01GP12
RST3
UART RX4UART TX5GP26 GP3 7SDA 8SCL 9VUSB 10D- 11
D+ 12VSS 13
MCP2221A-I/ML
U1
ID4
VBUS1
GND5
D-2D+3ID
VBUS
GND
D-D+
0
USB MINI-B Female
J3
USB_NUSB_P
10kR4
DGND
5V_USB
1kR10
1kR9
DGND
PGNDDGND
12
34
TERMINAL 1x4J7
TP17
TP16
10k06031%
R31
3.3k06031%
R41
82k06031%
R25
100R
R27
SS2PH10-M3/84A
D3
GND4
3 5VDD2
MCP1416T-E/OT
U2
VTRIG
1uF16V
C40
1uF16V0603
C28
V
PGNDPGND
TP LOOP Black TH
TP13
2.2uF50V
C11
10uF10V0805
C10
+5V
1N4148W
D12
0.47uF16V0603
C12
TP LOOP Black TH
TP7
DGND
16.2k06031%
R161nF50V0603
C2315nF16V0603
C21
2.2uF100V1210
C242.2uF100V1210
C25
PGND PGND
2R201206
R28
FB1
5R601206
R32
1nF50V0805
C32
PGND
10kR29
22k0R33
2.2uFC34
100nFC33
AN
1978
DS00001978C
-page 34
2015-2020 Microchip Technology Inc.
-BOARD LEDs
Appendix H: SIMPLIFIED SCHEMATIC OF THE SEPIC LED DRIVER WITH FOUR ONFIGURE H-1: SIMPLIFIED SCHEMATIC OF THE SEPIC LED DRIVER WITH FOUR ON-BOARD LEDS
Note the following details of the code protection feature on Microchip devices:• Microchip products meet the specification contained in their particular Microchip Data Sheet.
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of ourproducts. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such actsallow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding deviceapplications and the like is provided only for your convenienceand may be superseded by updates. It is your responsibility toensure that your application meets with your specifications.MICROCHIP MAKES NO REPRESENTATIONS ORWARRANTIES OF ANY KIND WHETHER EXPRESS ORIMPLIED, WRITTEN OR ORAL, STATUTORY OROTHERWISE, RELATED TO THE INFORMATION,INCLUDING BUT NOT LIMITED TO ITS CONDITION,QUALITY, PERFORMANCE, MERCHANTABILITY ORFITNESS FOR PURPOSE. Microchip disclaims all liabilityarising from this information and its use. Use of Microchipdevices in life support and/or safety applications is entirely atthe buyer’s risk, and the buyer agrees to defend, indemnify andhold harmless Microchip from any and all damages, claims,suits, or expenses resulting from such use. No licenses areconveyed, implicitly or otherwise, under any Microchipintellectual property rights unless otherwise stated.
2015-2020 Microchip Technology Inc.
For information regarding Microchip’s Quality Management Systems, please visit www.microchip.com/quality.
TrademarksThe Microchip name and logo, the Microchip logo, Adaptec, AnyRate, AVR, AVR logo, AVR Freaks, BesTime, BitCloud, chipKIT, chipKIT logo, CryptoMemory, CryptoRF, dsPIC, FlashFlex, flexPWR, HELDO, IGLOO, JukeBlox, KeeLoq, Kleer, LANCheck, LinkMD, maXStylus, maXTouch, MediaLB, megaAVR, Microsemi, Microsemi logo, MOST, MOST logo, MPLAB, OptoLyzer, PackeTime, PIC, picoPower, PICSTART, PIC32 logo, PolarFire, Prochip Designer, QTouch, SAM-BA, SenGenuity, SpyNIC, SST, SST Logo, SuperFlash, Symmetricom, SyncServer, Tachyon, TempTrackr, TimeSource, tinyAVR, UNI/O, Vectron, and XMEGA are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
APT, ClockWorks, The Embedded Control Solutions Company, EtherSynch, FlashTec, Hyper Speed Control, HyperLight Load, IntelliMOS, Libero, motorBench, mTouch, Powermite 3, Precision Edge, ProASIC, ProASIC Plus, ProASIC Plus logo, Quiet-Wire, SmartFusion, SyncWorld, Temux, TimeCesium, TimeHub, TimePictra, TimeProvider, Vite, WinPath, and ZL are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any Capacitor, AnyIn, AnyOut, BlueSky, BodyCom, CodeGuard, CryptoAuthentication, CryptoAutomotive, CryptoCompanion, CryptoController, dsPICDEM, dsPICDEM.net, Dynamic Average Matching, DAM, ECAN, EtherGREEN, In-Circuit Serial Programming, ICSP, INICnet, Inter-Chip Connectivity, JitterBlocker, KleerNet, KleerNet logo, memBrain, Mindi, MiWi, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, PowerSmart, PureSilicon, QMatrix, REAL ICE, Ripple Blocker, SAM-ICE, Serial Quad I/O, SMART-I.S., SQI, SuperSwitcher, SuperSwitcher II, Total Endurance, TSHARC, USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.The Adaptec logo, Frequency on Demand, Silicon Storage Technology, and Symmcom are registered trademarks of Microchip Technology Inc. in other countries.GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries. All other trademarks mentioned herein are property of their respective companies.
© 2015-2020, Microchip Technology Incorporated, All Rights Reserved.
ISBN: 978-1-5224-5581-3
DS00001978C-page 35
2015-2020 Microchip Technology Inc. DS00001978C-page 36
AMERICASCorporate Office2355 West Chandler Blvd.Chandler, AZ 85224-6199Tel: 480-792-7200 Fax: 480-792-7277Technical Support: http://www.microchip.com/supportWeb Address: www.microchip.comAtlantaDuluth, GA Tel: 678-957-9614 Fax: 678-957-1455Austin, TXTel: 512-257-3370 BostonWestborough, MA Tel: 774-760-0087 Fax: 774-760-0088ChicagoItasca, IL Tel: 630-285-0071 Fax: 630-285-0075DallasAddison, TX Tel: 972-818-7423 Fax: 972-818-2924DetroitNovi, MI Tel: 248-848-4000Houston, TX Tel: 281-894-5983IndianapolisNoblesville, IN Tel: 317-773-8323Fax: 317-773-5453Tel: 317-536-2380Los AngelesMission Viejo, CA Tel: 949-462-9523Fax: 949-462-9608Tel: 951-273-7800 Raleigh, NC Tel: 919-844-7510New York, NY Tel: 631-435-6000San Jose, CA Tel: 408-735-9110Tel: 408-436-4270Canada - TorontoTel: 905-695-1980 Fax: 905-695-2078
ASIA/PACIFICAustralia - SydneyTel: 61-2-9868-6733China - BeijingTel: 86-10-8569-7000 China - ChengduTel: 86-28-8665-5511China - ChongqingTel: 86-23-8980-9588China - DongguanTel: 86-769-8702-9880 China - GuangzhouTel: 86-20-8755-8029 China - HangzhouTel: 86-571-8792-8115 China - Hong Kong SARTel: 852-2943-5100 China - NanjingTel: 86-25-8473-2460China - QingdaoTel: 86-532-8502-7355China - ShanghaiTel: 86-21-3326-8000 China - ShenyangTel: 86-24-2334-2829China - ShenzhenTel: 86-755-8864-2200 China - SuzhouTel: 86-186-6233-1526 China - WuhanTel: 86-27-5980-5300China - XianTel: 86-29-8833-7252China - XiamenTel: 86-592-2388138 China - ZhuhaiTel: 86-756-3210040
ASIA/PACIFICIndia - BangaloreTel: 91-80-3090-4444 India - New DelhiTel: 91-11-4160-8631India - PuneTel: 91-20-4121-0141Japan - OsakaTel: 81-6-6152-7160 Japan - TokyoTel: 81-3-6880- 3770 Korea - DaeguTel: 82-53-744-4301Korea - SeoulTel: 82-2-554-7200Malaysia - Kuala LumpurTel: 60-3-7651-7906Malaysia - PenangTel: 60-4-227-8870Philippines - ManilaTel: 63-2-634-9065SingaporeTel: 65-6334-8870Taiwan - Hsin ChuTel: 886-3-577-8366Taiwan - KaohsiungTel: 886-7-213-7830Taiwan - TaipeiTel: 886-2-2508-8600 Thailand - BangkokTel: 66-2-694-1351Vietnam - Ho Chi MinhTel: 84-28-5448-2100
EUROPEAustria - WelsTel: 43-7242-2244-39Fax: 43-7242-2244-393Denmark - CopenhagenTel: 45-4450-2828 Fax: 45-4485-2829Finland - EspooTel: 358-9-4520-820France - ParisTel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 Germany - GarchingTel: 49-8931-9700Germany - HaanTel: 49-2129-3766400Germany - HeilbronnTel: 49-7131-72400Germany - KarlsruheTel: 49-721-625370Germany - MunichTel: 49-89-627-144-0 Fax: 49-89-627-144-44Germany - RosenheimTel: 49-8031-354-560Israel - Ra’anana Tel: 972-9-744-7705Italy - Milan Tel: 39-0331-742611 Fax: 39-0331-466781Italy - PadovaTel: 39-049-7625286 Netherlands - DrunenTel: 31-416-690399 Fax: 31-416-690340Norway - TrondheimTel: 47-7288-4388Poland - WarsawTel: 48-22-3325737 Romania - BucharestTel: 40-21-407-87-50Spain - MadridTel: 34-91-708-08-90Fax: 34-91-708-08-91Sweden - GothenbergTel: 46-31-704-60-40Sweden - StockholmTel: 46-8-5090-4654UK - WokinghamTel: 44-118-921-5800Fax: 44-118-921-5820
Worldwide Sales and Service
05/14/19