In message <5.1.1.6.2.20040620101859.02155bb0@mail.cedar.net> David VanHorn wrote: > First, from both sides of your current sense resistor, bring down dividers, > equal value resistors. 1%, or even hand matched. > Now you have Va/2 and Vb/2 where Va and Vb are the voltages on your current > sense resistor. We've just cut your current sense output in half, but now > the voltages are nicely centered around half the battery voltage. These > resistors draw current from the battery all the time, so think large. > 10k-100k would probably work. OK, I see where you're going from there... > From here, a differential amplifier can strip off the remaining DC offset, > and add gain to the current sense voltage, and a following stage can add > half your reference voltage, so that 128 counts or thereabouts, will be 0 > current. Not to play expert or anything, but I guess that means I'd need a negative supply voltage for the opamp stages. At the moment, nothing else on the board needs a negative supply. I suppose I could use a PIC based chargepump to generate the negative supply, then use a Zener to clamp it. Is there any way to implement the opamp stages without using a negative supply? Ordinarily I'd just put the charge pump in, but board space is very much at a premium (think "Walkman sized") and I need to scavenge as much power from the battery as possible. The switchmode regulator can only handle 90mA, and that needs to power an MP3 decoder (30mA peak), a PIC (4mA peak) and a few other bits and pieces (about 10mA). That leaves 45mA for "other stuff" like battery gas-gauge and charge controllers :) Thanks. -- Phil. | Acorn Risc PC600 Mk3, SA202, 64MB, 6GB, philpem@dsl.pipex.com | ViewFinder, 10BaseT Ethernet, 2-slice, http://www.philpem.dsl.pipex.com/ | 48xCD, ARCINv6c IDE, SCSI ... Did you know that no-one ever reads these things? -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads