Developing consumer products can often involve the design of small, low-cost, handheld, battery-powered circuits with an embedded controller. Thanks to the availability of inexpensive 8-bit processors packing lots of functionality, this challenge can be met by letting the processor do as much as possible. One function the processor can handle with a minimum of external components and minor software overhead is regulation of its own power supply.
The idea presented here uses the analog-to-digital converter (ADC) and pulse-width-modulation (PWM) hardware in the PIC16C72 processor to implement an efficient, low-cost, regulating power supply (see the figure). First, a common 9-V battery is stepped down (using R2) to an adjustable 4.6 V to 7.0 V. The supply is intended to source less than 10 mA with minimal ripple but can source as much as 40 mA if more ripple can be tolerated. Ripple also can be decreased by increasing the inductor and capacitor values if size permits, and by modifying the software feedback control.
Although the power supply topology shown has no functionality, it’s a starting point for designing any number of battery-operated standalone systems that need an embedded processor. In this example, the powersupply control software overhead is only about 10%. By using surfacemount components and adding other low-power circuitry (such as LCDs, CMOS op amps, and sensors), this circuit represents a good starting point for real-world applications.
The circuit works as follows. When the On/Off switch S1 is switched on, the PIC is initially powered through D2 with just enough power (regulated by R1 and the 5.1-V Zener D1) so that the PIC can come out of reset and begin regulating as a step-down controller. Once the PIC is out of reset, it begins driving the LC step-down regulator with a pulse-width-modulated 50-kHz signal through the dual (nchannel and p-channel) FETs contained in the IRF7105 (Q1).
If any additional circuitry is added to this system, care should be taken so that it doesn’t load down the circuit too heavily during the initial powerup stage. Once the step-down voltage exceeds the voltage sourced through D2, then R1, D1, and D3 merely act as the voltage reference for the PIC ADC. The circuit as shown draws approximately 4 mA from the battery with the regulation voltage set at 5 V. The PWM control in this example is done entirely during the analog-to-digital interrupt service routine.