A method and apparatus for digitally controlling the average input current
of a switch mode power supply are disclosed. In preferred embodiments,
the switch mode power supplies are DC-DC converters. One aspect of the
invention relates to a method for controlling the switch of a switch mode
power supply by digitally sampling the input current once during each
power supply switching cycle at a time that is synchronized with the
switching cycle. The predetermined time at which the input current is
sampled may be midway through the time that the switch is in the "ON"
state. This midway time may also be delayed slightly to compensate for
delays associated with the switch.