数字式恒流LED驱动器
ThisdocumentdescribesapowerLEDdriversolution
usingthePIC12HV615microcontroller(MCU).The
PIC12HV615isan8-pinMCUwithmanyintegrated
analogfeatures.TheLEDdrivercircuitisabuck(step-
down)solutionandthecircuitpresentedherecan
operatefrommostanyinputvoltagesourceaslongas
itexceedstheforwardvoltageoftheLEDstobedriven.
Aproportional-integral(PI)controlleralgorithmisused
toregulatetheLEDcurrenttoaconstantvalue.ThePI
controllerisexecutedatarateof976Hz,leavingplenty
ofCPUtimeavailableforothertasks.Althoughthis
sampleratewouldprovideinadequatecontrol
responseformostpowersupplyapplications,itworks
wellforLEDapplicationsbecausetheLEDpresentsa
constantloadtothepowerstage.Therefore,the
controllerdoesnotneedtomakefrequentadjustments.
TheLEDcurrentissampledusingaresistorinseries
withthesourceoftheMOSFETinthebuckcircuitand
amplifiedusingasingleopamp.TheLEDcurrentis
sampledusingoneoftheavailableADCinputsonthe
PIC12HV615.TheEnhancedCaptureComparePWM
(ECCP)moduleoftheMCUisusedinPWMmodeto
drivethebuckcircuit.SincetheMCUhasaninternal
voltageregulatorand8MHzoscillator,veryfew
externalcomponentsarerequiredtocompletethe
circuit.AN1138ADigitalConstantCurrentPowerLEDDriverdrivecurrentforthistypeofLEDwouldbe350mAandAuthor:StephenBowlingatypicalforwardvoltagewouldbe3.5V.Secondly,weMicrochipTechnologyInc.willassumethatthecircuitinputvoltageis12V.Theinductorvaluewillbechosentoallowamaximumcurrentrippleof+/-20%.TheeyewillnotbeabletoINTRODUCTIONperceivethiscur