FS#9728 - Battery current measuring on the Video iPod

Attached to Project: Rockbox
Opened by Boris Gjenero (dreamlayers) - Tuesday, 30 December 2008, 18:51 GMT
Last edited by Torne Wuff (torne) - Tuesday, 03 November 2009, 20:35 GMT
Task Type Patches
Category Battery/Charging
Status Closed
Assigned To No-one
Operating System iPod 5G
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This patch allows battery current to be viewed at the debug screen. It adds another channel in firmware/target/arm/ipod/adc-ipod-pcf.c. In "View I/O ports", the raw value is displayed as 4066_ISTAT. In the "Power status" screen of "View battery" the value scaled to milliamps and power in milliwatts is displayed. The current is flowing into the battery when charging and out of the battery when discharging. When external power is supplied and the battery is charged, current is zero.

Note that current is dependent on battery voltage, because at lower voltages the DC-DC converters need more input current for the same output power. That's why I chose to also display power (based on Vbat * Ibat). That may still be slightly wrong if Vbat changed between readings, and DC-DC converter efficiency may change as voltage changes. It's probably best to compare current on the same device at the same Vbat.

These values are also displayed in the iPod diagnostic, in Power -> A2DTests -> ChargingADC. I did not verify the accuracy of the scale factor; I just use the same one. The name 4066_ISTAT implies that this reading comes from the ISTAT pin of the LTC4066 chip.
This task depends upon

Closed by  Torne Wuff (torne)
Tuesday, 03 November 2009, 20:35 GMT
Reason for closing:  Fixed
Additional comments about closing:  Committed in r23500
Comment by Boris Gjenero (dreamlayers) - Wednesday, 28 January 2009, 06:36 GMT
Here are some measurements comparing Firewire input power and Ibat. I'm using my 30 GB 5th generation iPod an an Apple A1070 wall charger which outputs 12.8 V with no load. The result is nice and linear. The only unexpected thing is the difference in slope between charging and discharging, because the ISTAT graphs in the LTC4066 datasheet are more symmetrical.

Semi-related things:
* Pitch of edge connectors on ISA cards is close enough to firewire 6 pin connector pitch.
* My iPod cannot charge via USB, probably because that part of the LTC4066 is damaged
* I used PDF because I can export graphs from Excel that way, and the data is hosted here, not at Google
* These graphs also illustrate current savings from clearing the LCD, putting the LCD to sleep and shutting down the BCM.
Comment by Torne Wuff (torne) - Thursday, 23 July 2009, 16:25 GMT
Is there any reason not to commit this? dreamlayers' measurements seem to show the scaling factor is right (which you would hope anyway since it was from the diagmode rom), and it's handy reference information...
Comment by Andree Buschmann (Buschel) - Saturday, 24 October 2009, 12:07 GMT
Updated patch to compile against latest changes in debug_menu.c
Also removed some tabs.