The invention presents a switching control circuit for a
primary-side-controlled power converter. A pattern generator produces a
digital pattern to control a programmable capacitor that is connected to
an oscillator, which produces frequency hopping to reduce the EMI. A
voltage-waveform detector produces a voltage-feedback signal and a
discharge-time signal by multi-sampling a voltage signal of a
transformer. A current-waveform detector and an integrator generate a
feedback signal. The integration of a current-waveform signal with a
timing signal generates the average-current signal. Time constant of the
integrator is correlated to the switching frequency. The oscillator
generates the timing signal and a pulse signal in response to the output
of a current-loop error amplifier. A PWM circuit generates the switching
signal in response to the pulse signal and the output of a voltage-loop
error amplifier for switching the switching device and regulating the
output of the power converter.