A PWM controller for controlling a switching voltage regulator comprises a
first comparator, a second comparator and a third comparator. The first
comparator is configured to detect voltages of a first node and a second
node so as to determine whether to stop the PWM controller. The PWM
controller is stopped if a first potential is lower than a threshold, and
the first potential derives from the voltage of the first node by a level
shift of a first voltage difference. The second comparator is configured
to detect the voltage of the first node and then to compare the voltage
with a power reference voltage so as to determine whether the PWM
controller receives necessary power. The third comparator is configured
to compare the voltage of the second node with an enable reference
voltage so as to determine whether to disable the PWN controller.