So we tried all this again, and this time added a BQ24725 battery charger IC evaluation board to the kit. And some real batteries! Albeit small ones.
Part 1: Build, Josh, build!
After finding a really obnoxiously recent patch to the sbs-battery module, Josh heroically built us a 3.3.0-rc4 kernel and installed it on the CF card! And it booted! But then....
Part 2: Oh woe! Josh left us! Go back to old things.
Gah, we forgot to include the e1000e module so we couldn't connect to the interwebs. Bah. Jamey's too lazy to build a new kernel, so we booted the live USB key from last time. Lo and behold, we saw the charger chip at chip address 0x09 on the SMBUS. Hooray!
sudo i2cdump -y 0 9 gave us the memory dump, and the last two bytes were 0x40 0x08 which is sweet since the data sheet says
|REGISTER ADDRESS||REGISTER NAME||READ/WRITE||DESCRIPTION||POR STATE|
|0XFEH||ManufacturerID()||Read Only||Manufacturer ID||0x0040H|
|0xFFH||DeviceID()||Read Only||Device ID||0x0008H|
Next, we read the status from the BQ3060 to make sure it was happy:
sudo i2cset -y 0 0xb 0 6 w
sudo i2cget -y 0 0xb 0 w
0x010a== discharging normally, so yay, that means it's happy.
Part 3: Talking to the BQ24725 and charging batteries
First we played around:
sudo i2cget -y 0 9 0x12 wgot us
0x7904which is what the eval kit demos says it should be (page 5, step 11).
Eventually, we got it to charge!:
- Check out the important BQ24725 registers is:
sudo i2cdump -y -r 0x12-0x15 0 9 w
- Turn off charging (must do before changing any parameters):
sudo i2cset -y 0 9 0x12 0x7905 w(see table 3 in datasheet)
- Turn on charging:
sudo i2cset -y 0 9 0x12 0x7904 w(see table 3 in datasheet)
- Set charge voltage to 16.384V:
sudo i2cset -y 0 9 0x15 16384 w(see table 5)
- Set charge current to 256mA:
sudo i2cset -y 0 9 0x14 256 w(see table 4)
To prove that we were charging, we asked the BQ3060
sudo i2cget -y 0xb 0 w and it sat
0x050a which is "I'm charging!".