A switching controller having frequency hopping is used for reducing the
EMI of a power supply. A pattern generator generates a digital pattern
code in response to a clock signal. An oscillator generates an
oscillation signal for determining a switching frequency of a switching
signal. A programmable capacitor coupled to the oscillator modulates the
switching frequency in response to the variation of the digital pattern
code. An attenuator connected to a voltage feedback loop attenuates a
feedback signal. The feedback signal controls the pulse width of the
switching signal. A programmable resistor coupled to the attenuator
determines an attenuation rate of the attenuator in response to the
digital pattern code. The attenuation rate is increased as the switching
frequency increases. The pulse width of the switching signal is thus
reduced, which compensates the decrease of the switching period and keeps
the output power and the output voltage constant.