Frantisek Dufka <[EMAIL PROTECTED]> writes:
> As for bme and figuring out how battery charging works, one could strace 
> it and see what tahvo/retu register it uses,

I did this once for the 770 (by modding the kernel, same basic
results).  There are some undocumented RETU and TAHVO ports that
control the charge circuit.  They're undocumented because setting them
wrong causes the battery to overheat and possibly explode.  Read at
your own risk!

retu interrupt mask 0x0100 is a 5 second timer used for charge timing.
the ADCs are documented in that link you mentioned.
retu register 9 has bits that control the charge process but I never decoded
them fully.
reg 15 and 16 are also involved in controlling the regulator.
reg 20 mask 0x1000 is set when the charger is plugged in

tahvo register 4 is the charge control frob.  Values from 0 (disable
charging) to 255 (maximum charge rate) can be written.  Must
coordinate with ADC values or the battery goes boom!

tahvo reg 8 controls charging but I don't know exactly what the bits
do (except that mask 0x0001 global-enables the charger).  Same for reg
12.

tahvo reg 13 is a signed 16 bit ADC that tells you the current flowing
into the battery (positive when charging, negative when running).  I
don't know the scale.

The overall charge process is one of setting the charge current to try
to get a specific voltage (i.e. constant current (max) at first,
followed by variable current (mostly reducing) to get constant
voltage) and periodically shutting down the charger to read the "idle"
voltage/current.  When you need to set the charge to zero current to
get the right voltage, you're done.  This is a standard lithium charge
cycle.

I'm guessing the periodic shutdown helps it deduce charge time ETA.
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to