Patent ID: 8471536

Claim:
A switch controller applied in a switching power supply, the switching power supply comprising an auxiliary winding and a primary winding coupled to an input power source, the primary winding controlled by a power switch to charge or discharge so as to generate an output power source, the switch controller comprising: a driving circuit, for turning on or turning off the power switch so as to charge or discharge the primary winding; a clamping circuit, comprising a detecting end coupled to the auxiliary winding through a detecting resistor, wherein the detecting end is substantially maintained above a predetermined voltage using a detecting current; and a detecting circuit, for generating a control signal according to the detecting current so as to control the driving circuit, comprising: a current mirror to provide the detecting current and a reflecting current, the reflecting current is proportional to the detecting current, and the detecting current flows through the detecting resistor across which a voltage approximately corresponds to a voltage level of the input power source.