A voltage-waveform detector produces a voltage-feedback signal and a
discharge-time signal by multi-sampling a voltage signal of a
transformer. The discharge-time signal represents a discharge time of a
secondary-side switching current. A voltage-loop error amplifier
amplifies the voltage-feedback signal and generates a control signal. An
off-time modulator correspondingly generates a discharge-current signal
and a standby signal in response to the control signal and an
under-voltage signal. The under-voltage signal indicates a low supply
voltage of the controller. An oscillator produces a pulse signal in
response to the discharge-current signal. The pulse signal determines the
off-time of the switching signal. A PWM circuit generates the switching
signal in response to the pulse signal and the standby signal. The
standby signal further controls the off-time of the switching signal and
maintains a minimum switching frequency. The switching signal is used for
regulating the output of the power supply.