tl;dr: there's no need for an EEPROM programmer, you just have to fully charge the battery, then run the computer in the Mac OS X installer until the machine shuts off. Plug it in, boot the machine, and after 20 seconds or so, the battery will happily report the new capacity.
Howdy, I thought I'd chime in here as I recently rebuilt an Apple-branded iBook clamshell battery. The original battery had 300 cycles on it, and the cells read 0.1 - 0.3v each. It wasn't swollen or leaking, luckily, and I was able to crack it open very carefully with a flathead (avoiding the side of the battery that has the black connector, as I learned from a previous disassembly that it contains a ribbon cable running the length of the battery that's very easily damaged!).
I used LG MJ1 3500mAh batteries with tabs from eBay, and I had to remove the clear plastic that was wrapped around them to get them to fit nicely. It was a chore to bend and cut the metal tabs just right to fit the ribbon, but after some finagling, some soldering (and a spark or two), I got it lined up and assembled. I was able to snap the case back together and everything fit perfectly, albeit snug, with the adhesive holding the battery pack together by the cells.
The batteries were nearly fully charged when I got them, and when I put the assembled battery pack in the iBook, it charged from "0%" to 100% in 15 minutes. Running the following command gave some bad news:
Code:
system_profiler SPPowerDataType
The output showed Full Charge Capacity as 186mAh! No matter what I did, I could only get 10 minutes of runtime out of the battery. I tried PMU resets, PRAM resets, I tried installing the Battery Reset 2.0 extension in an original clamshell and rebooting, I tried putting it into a clamshell with a dead PRAM supercapacitor and performing a PMU reset, then I tried a PMU reset in one with a known-good PRAM supercapacitor. I tried draining it until the computer slept, then charging. I tried draining it for multiple hours down to 15V, then charging. Nothing seemed to help.
Then I found this thread and the linked datasheet, and in the
Gas Gauge Operation section, I read the following:
1. FullChargeCapacity or learned-battery capacity
FCC is the last measured discharge capacity of the battery. On initialization (application of VCC or reset), FCC is set to the value stored in the EEPROM. During subsequent discharges, FCC is updated with the latest measured capacity in the Discharge Count Register, representing a discharge from full to below EDV1. A qualified discharge is necessary for a capacity transfer from the DCR to the FCC register. Once updated, the bq2945 writes the new FCC to the EEPROM. The FCC also serves as the 100% reference threshold used by the relative state-of-charge calculation and display.
This means that, if I can discharge the battery from a fully charged pack voltage of around 17V down to whatever
EDV1 is, then start a new charge cycle, the battery would update the FCC register with the count.
But how do you do this, and what is the value of EDV1?
Since the machine would sleep after 10 minutes if I booted it into Mac OS, my answer was to use the Tiger installer to drain the battery, which, despite the initial warnings that the battery is low and the system will sleep soon, does not go to sleep -- the menubar icon just goes from showing an empty battery to showing a full battery, and it simply stays powered on. You could probably leave the machine at the boot picker too, but I wanted to monitor progress.
So, I used `dd` to copy the Tiger install ISO to a USB thumb drive, then powered on the machine and booted into Open Firmware by holding Command + Option + OF. I issued the following command to boot the Tiger installer from the USB drive:
Code:
probe-usb boot usb0/disk:3,\\:tbxi
Once in the installer, I first went to Disk Utility and umounted my internal drive (since I didn't want to deal with corruption issues when the machine inevitably powers off from a dead battery), then I opened Terminal and issued the following command to monitor the battery:
Wiki:
while [ True ]
do
system_profiler SPPowerDataType
sleep 10
done
I then let it go for over 6.5 hours, monitoring the reported voltage. Shortly after I saw the pack voltage hit something like 12013mV, the computer shut off.
Then, I unplugged the USB and booted into Mac OS X from the HD, opened up Terminal and issued the same `system_profiler` command -- but it still read 186mAh for Full Charge Capacity and said only 12 minutes to charge to 100%!
I was discouraged, but seconds later I realized the menu bar now said 3:47 to a full charge, and when I ran the command again, I was happy to see 5258mAh reported as FCC (and the same info in coconutBattery)!
This means EDV1 is programmed as 12.0V, and all you have to do is drain the battery down from a full charge to below 12.0V to trigger the routine to update the FCC register and get your re-celled battery pack performing like new.