Abstract: Disclosed is a battery charger capable of charging a rechargeable battery in accordance with three different types of charge modes. These three charge modes are constant current, constant voltage, and constant current followed by a constant voltage. A microprocessor receives as input signals from a battery indicating the battery type and the battery voltage. The microprocessor automatically outputs control signals which activate certain circuitry depending upon the inputs received from the battery. A regulator outputs a switching voltage that is converted into either a constant current or a constant voltage depending upon the circuitry activated. The circuitry provides feedback to the regulator so that the proper pulse width is output by the regulator depending upon the current or voltage sensed.