µC controls charge pump as background task
Because of power consumption and cost, designers of battery-powered devices mainly choose components that run at 3V or lower. Unfortunately, many devices operate only at 5V, including LCDs with built-in drivers, programming lines of many EEPROMs and flash chips, and CMOS ADCs. You thus need a small, inexpensive dc/dc converter to supply the 5V. If your system uses a low-cost µC, you can use some mC resources (two high-current I/O pins, a timer, and a software trick) and a few external components (two diodes and two capacitors) to build an inexpensive charge pump (Figure 1). The pump runs as a background software task to generate the needed 5V.
Because the charge pump uses a full-wave voltage doubler, it's necessary to generate in software an ac signal of +3 to 3V that is capable of charging every capacitor to 3V. To obtain this type of signal using a µC powered only by 3V, it's necessary to change the ground voltage you apply to the common or reference alternately between AC1 and AC2. That is, to obtain a positive half-cycle of 3V, the AC1 pin must pull up to 3V while the AC2 pin pulls down to 0V. Similarly, to obtain a negative half-cycle of 3V, the AC1 pin must pull down to 0V, and the AC2 pin must pull up to 3V. The result is a square wave that alternates between 3 and 3V (Figure 2).
Capacitor C1 charges during the positive half-cycle of the signal, and capacitor C2 charges during the negative half-cycle. Thus, for light loads, the output voltage from both capacitors is approximately 6V. If you need a regulated 5V output, you can insert a zener diode to clamp the voltage at 5V. The assembly code in Listing 1 applies to Motorola's (Phoenix, AZ) low-cost MC68HC705K1 µC. The software uses the µC's periodic-timer interrupt capability every millisecond to obtain a 500-Hz frequency, a rate low enough to fully charge C1 and C2 without compromising system performance. (Click here to downloadListing 1.)
You can effect a shutdown feature if you disable the timer interrupt during the program execution. You can thus save battery life by turning off the charge pump when the device requesting 5V is idle. (DI #2063)