主权项 |
1. An LED driver, comprising:
a switching converter configured to provide a driving current for an LED, wherein the switching converter has a main switch and a first winding coupled to the main switch, and wherein the first winding stores energy when the main switch is on and provides the energy to the LED when the main switch is off; a second winding magnetically coupled to the first winding, wherein the second winding has a first terminal configured to provide a power supply voltage and a second terminal; a first sensing resistor having a first terminal and a second terminal, wherein the first terminal is coupled to the main switch; a second sensing resistor having a first terminal and a second terminal, wherein the first terminal is coupled to the second terminal of the first sensing resistor and the second terminal of the second winding, the second terminal is coupled to a reference ground; an output current calculator coupled to the first terminal of the first sensing resistor, wherein based on the voltage at the first terminal of the first sensing resistor, the output current calculator calculates an equivalent value of the driving current and generates an equivalent current signal; an error amplifier coupled to the output current calculator and configured to generate a compensation signal based on the equivalent current signal and a reference voltage; and a control circuit coupled to the error amplifier, wherein based on the compensation signal, the control circuit generates a control signal to control the main switch. |