Patent ID: 8742740

Claim:
An integrated circuit controller for a power converter, the controller comprising: a digital peak detector to be coupled to receive a rectified voltage signal that is representative of a time-varying input voltage of the power converter that has a peak value each input voltage cycle of the power converter, wherein the digital peak detector is coupled to generate a digital count signal representative of the peak value of the time-varying input voltage, and coupled to output a digital count signal representative of a peak input voltage of the power converter, wherein the digital peak detector comprises: a counter coupled to increment a count of the counter in response to a clock signal and to output the digital count signal, wherein the digital count signal is representative of the count, and wherein the counter is coupled to be reset each input voltage cycle of the power converter; a plurality of current sources coupled to the counter to output a total current signal having a value responsive to the count of the counter; and a comparator coupled to compare the total current signal and a current signal representative of the time-varying input voltage of the power converter, wherein the counter is further coupled to stop counting when total current signal is greater than the current signal representative of the input voltage; and a switching block coupled to control switching of a power switch of the power converter to regulate an output of the power converter, wherein the switching block is coupled to control the switching of the power switch in response to the digital count signal.