In my Raspberry Pi tablet, I use very low frequency PWM to measure the battery voltage. One half of a dual voltage comparator was set up as a sawtooth oscillator operating at approximately 100Hz. The output of this was compared against a divided-down version of the battery voltage by the other half. The output of that in turn was tied into a GPIO pin.
Software running on the Pi samples the GPIO pin approximately 1000 times per second (with no guarantee of timing accuracy). These readings are stored in a circular buffer of 16384 entries, each 0 or 1. The floating point average of all the entries is computed, shifted, and scaled, to get a voltage reading. It takes about 16 seconds to get the first reading, after which it's a rolling average of the last 16 seconds.
Response time is obviously very slow, and the reading can potentially fluctuate, but in practice it is accurate enough for its intended purpose. For critical decisions, such as the battery being so low that a shutdown should soon take place, the condition must be present for at least one minute to be considered real.
The advantage to this approach is that it requires no proprietary chips, just an LM393 that's been available for decades. The drawback is that it requires more discrete parts than a more modern solution might.
The schematic and a more detailed description can be found at A Compact Home-Made Raspberry Pi Tablet, and the source code at Power, Display, and UI Management Daemon for DIY Raspberry Pi Tablet
since the inductor current is not always flowing to the load, the efficiency of boost converters is generally lower than their bucking counterparts
.