Patent ID: 7830688

Claim:
A voltage regulator, comprising: a switching circuit to alternate between a first state in which an intermediate terminal is connected to an input terminal and a second state in which the intermediate terminal is connected to a ground; an output terminal coupled to the intermediate terminal; control circuitry configured to measure an output voltage at the output terminal, determine a control signal based on the output voltage, determine a first threshold based on the control signal and a first offset, make a first measurement of an output current at the intermediate terminal, control the switching circuit to switch from one of the first state and the second state to another of the first state and the second state when the output current crosses the first threshold, determine a second threshold based on the control signal and a second offset, and adjust the first offset or the second offset based on a comparison of the first measurement of the output current to the second threshold; and a filter coupled to the switching circuit to provide a generally DC output voltage at the output terminal.