changeset 1:fa09662fe3e2

batteries, charging: import from fc-battery-conf repository
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 04 Apr 2022 07:56:53 +0000
parents 6ef2edd7ab6d
children a4edf5415c74
files batteries/pirelli charging/c1xx/standard charging/pirelli/manual
diffstat 3 files changed, 114 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/batteries/pirelli	Mon Apr 04 07:56:53 2022 +0000
@@ -0,0 +1,29 @@
+# This table of battery millivolts to state-of-charge percentages
+# is assumed to be correct for Pirelli's battery, as it is used by
+# Pirelli's firmwares.  It may or may not be correct for other
+# FreeCalypso phone batteries.
+#
+# The third field added in 2020-11 specifies thresholds for the
+# battery bars icon in the phone handset UI.
+
+4170	100
+4120	95
+4070	90
+4030	85
+3964	80
+3930	75
+3900	70	4
+3882	65
+3847	60
+3805	55
+3786	50	3
+3771	45
+3759	40
+3750	35
+3745	30
+3737	25	2
+3719	20
+3688	15
+3663	10
+3539	5	1
+3370	0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/charging/c1xx/standard	Mon Apr 04 07:56:53 2022 +0000
@@ -0,0 +1,56 @@
+# This is the "standard" charging config for Mot C1xx phones running
+# FreeCalypso fw.  The key points are:
+#
+# 1) The battery is charged to the full 4.2 V, not a lower voltage,
+# for traditional mobile phone usage patterns in which the user charges
+# the battery fully before going out.
+#
+# 2) The start threshold is set fairly high on the reasoning that if
+# the user connects the charging power source (which is not USB and thus
+# not required for computer connection), it means that she actually intends
+# to charge the battery, but it is set to 4100 mV instead of "always"
+# so that if the battery is really full, an explicit AT@CHG=1 command
+# or a future UI equivalent will be needed to force a charging start.
+#
+# 3) The restart threshold is a reasonable setting so if the phone is left
+# plugged into the charger for a long time, the user won't be surprised
+# with a battery that has run down significantly after the completion
+# of the initial charging cycle.
+
+start-threshold			4100	# mV
+restart-threshold		3900	# mV
+
+# Constant Voltage charging parameters mostly copied from Pirelli
+
+ci2cv-threshold			4245	# mV, lowered from Pirelli's 4250
+cv-initial-setpoint		4220	# mV
+cv-ctrl-loop-high		4236	# mV
+cv-ctrl-loop-low		4170	# mV, bumped up from Pirelli's 4160
+cv-dac-max-incr			8	# DAC units
+cv-dac-max-decr			50	# DAC units
+cv-ctrl-loop-sample-count	6	# our logic is simpler than Pirelli's
+overvoltage			4280	# mV, bumped up from Pirelli's 4270
+
+# For the current settings, keep in mind that C1xx phones use a current
+# measurement resistor of 0.15R instead of TI's "canonical" value of 0.20R,
+# hence the conversion factor between mA and ADC/DAC numbers changes
+# accordingly.  The CI current setting is based on what Motorola's fw
+# has been observed to set, but the end current setting is our own,
+# chosen empirically.
+
+ci-current			280	# DAC units, about 320 mA
+end-current			60	# ADC units, about 68 mA
+ichg-max-spike			26	# ADC units, about 30 mA
+ichg-low-samples-needed		30	# sample count
+
+# The apppropriate charging time limit and restart delay have yet to be
+# determined; for now we give it a super-generous 6 h charging time limit
+# and 2 h restart delay.
+
+charging-time-limit		21600
+restart-delay			7200
+
+# Motorola's fw does not seem to use the I2V offset mechanism,
+# but we use the same setting as Pirelli.
+
+i2v-offset			0x18	# register setting
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/charging/pirelli/manual	Mon Apr 04 07:56:53 2022 +0000
@@ -0,0 +1,29 @@
+# This charging config is intended for those usage scenarios in which your
+# Pirelli phone runs FreeCalypso fw only occasionally, with manual loading
+# via fc-xram for every session, and when you desire to have the ability
+# to charge when running FC fw, but not have charging happen automatically
+# on every fc-xram run.  With this config charging will only happen when
+# explicitly requested via AT@CHG=1.
+
+start-threshold			never
+restart-threshold		3900	# mV
+
+# Constant Voltage charging magic following Pirelli's fw
+
+ci2cv-threshold			4250	# mV
+cv-initial-setpoint		4220	# mV
+cv-ctrl-loop-high		4236	# mV
+cv-ctrl-loop-low		4170	# mV, bumped up from Pirelli's 4160
+cv-dac-max-incr			8	# DAC units
+cv-dac-max-decr			50	# DAC units
+cv-ctrl-loop-sample-count	6	# our logic is simpler than Pirelli's
+overvoltage			4280	# mV, bumped up from Pirelli's 4270
+
+# current settings, all in ADC/DAC native units
+
+ci-current			610	# DAC units
+end-current			122	# ADC units
+ichg-max-spike			35	# ADC units
+ichg-low-samples-needed		30
+
+i2v-offset			0x18	# register setting