Patent ID: 8593841

Claim:
A constant current controller for a switching mode power supply (SMPS), wherein the switching mode power supply includes a transformer having a primary winding coupled with a power switch and a secondary winding coupled with a secondary diode, the power switch is controlled by a control signal, the controller comprising: a detector circuit having a first input terminal, a second input terminal, a first output terminal and a second output terminal, wherein the first input terminal is configured to receive a feedback signal, the second input terminal is configured to receive a control signal, and based on the feedback signal and the control signal, the detector circuit generates and provides at the first output terminal a conduction time interval signal indicative of a conduction time of the secondary diode, and the detector circuit generates and provides at the second output terminal a demagnetizing oscillation signal; a first comparator having a first input terminal, a second input terminal, and an output terminal, wherein the first input terminal is coupled to a first reference signal; a first current source and a first switch coupled in series between an internal power signal and the second input terminal of the first comparator; a second current source and a second switch coupled in series between the second input terminal of the first comparator and a reference ground; a capacitor coupled between the second input terminal of the first comparator and the reference ground to provide a voltage across the capacitor to the second input terminal of the first comparator, wherein the first comparator generates and provides at the first comparator output terminal a first comparison signal based on the voltage across the capacitor and the first reference signal; a third current source and a third switch coupled in series between the internal power signal and the second input terminal of the first comparator; and a flip-flop having a first input terminal, a second input terminal and an output terminal, wherein the first input terminal is coupled to the first output terminal of the detector circuit to receive the conduction time interval signal, the second input terminal is coupled to the output terminal of the first comparator to receive the first comparison signal, and wherein based on the conduction time interval signal and the first comparison signal, the flip-flop provides a constant current control signal at the output terminal, wherein the control signal is based on the constant current control signal; wherein the first switch and the second switch are controlled by the conduction time interval signal, and the third switch is controlled by the demagnetizing oscillation signal.