A charging accessory for a portable electronic device has an input/output
port for providing electrical connections to an input/output port of the
device. The accessory includes a charger for charging the battery of the
portable electronic device and a discharging circuit for discharging the
battery of the device. A processor in the accessory determines when the
device battery is fully charged and fully discharged. A time stamp
associated with a charging/discharging cycle and device identification
information identifying the particular device upon which the charging
cycle was performed is stored in a memory of the accessory. The charging
accessory then automatically performs a discharging/charging operation
for the device according to a predetermined schedule to recalibrate a
battery level display of the device whenever the accessory is coupled to
the device.