Quectel LTE Module Series Charging User Manual

Type
Charging User Manual

This manual is also suitable for

Quectel LTE Module Series is a high-performance and versatile module series that supports a wide range of applications, including IoT, industrial automation, and mobile computing. With its compact size and low power consumption, the Quectel LTE Module Series is ideal for devices that require high performance and long battery life.

The Quectel LTE Module Series supports a variety of connectivity options, including LTE-FDD, LTE-TDD, and WCDMA. This makes it easy to connect to networks in a variety of locations, ensuring that your device can stay connected even in remote areas.

The Quectel LTE Module Series also supports a variety of features that make it easy to develop and deploy IoT applications. These features include:

Quectel LTE Module Series is a high-performance and versatile module series that supports a wide range of applications, including IoT, industrial automation, and mobile computing. With its compact size and low power consumption, the Quectel LTE Module Series is ideal for devices that require high performance and long battery life.

The Quectel LTE Module Series supports a variety of connectivity options, including LTE-FDD, LTE-TDD, and WCDMA. This makes it easy to connect to networks in a variety of locations, ensuring that your device can stay connected even in remote areas.

The Quectel LTE Module Series also supports a variety of features that make it easy to develop and deploy IoT applications. These features include:

SC20 Charging User Guide
LTE Module Series
Rev. SC20_Charging_User_Guide_V1.0
Date: 2016-09-26
www.quectel.com
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 1 / 14
Our aim is to provide customers with timely and comprehensive service. For any
assistance, please contact our company headquarters:
Quectel Wireless Solutions Co., Ltd.
Office 501, Building 13, No.99, Tianzhou Road, Shanghai, China, 200233
Tel: +86 21 5108 6236
Or our local office. For more information, please visit:
http://www.quectel.com/support/salesupport.aspx
For technical support, or to report documentation errors, please visit:
http://www.quectel.com/support/techsupport.aspx
Or email to: [email protected]
GENERAL NOTES
QUECTEL OFFERS THE INFORMATION AS A SERVICE TO ITS CUSTOMERS. THE INFORMATION
PROVIDED IS BASED UPON CUSTOMERS’ REQUIREMENTS. QUECTEL MAKES EVERY EFFORT
TO ENSURE THE QUALITY OF THE INFORMATION IT MAKES AVAILABLE. QUECTEL DOES NOT
MAKE ANY WARRANTY AS TO THE INFORMATION CONTAINED HEREIN, AND DOES NOT ACCEPT
ANY LIABILITY FOR ANY INJURY, LOSS OR DAMAGE OF ANY KIND INCURRED BY USE OF OR
RELIANCE UPON THE INFORMATION. ALL INFORMATION SUPPLIED HEREIN IS SUBJECT TO
CHANGE WITHOUT PRIOR NOTICE.
COPYRIGHT
THE INFORMATION CONTAINED HERE IS PROPRIETARY TECHNICAL INFORMATION OF
QUECTEL CO., LTD. TRANSMITTING, REPRODUCTION, DISSEMINATION AND EDITING OF THIS
DOCUMENT AS WELL AS UTILIZATION OF THE CONTENT ARE FORBIDDEN WITHOUT
PERMISSION. OFFENDERS WILL BE HELD LIABLE FOR PAYMENT OF DAMAGES. ALL RIGHTS
ARE RESERVED IN THE EVENT OF A PATENT GRANT OR REGISTRATION OF A UTILITY MODEL
OR DESIGN.
Copyright © Quectel Wireless Solutions Co., Ltd. 2016. All rights reserved.
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 2 / 14
About the Document
History
Revision
Date
Author
Description
1.0
2016-09-26
Luffy ZHANG
Initial
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 3 / 14
Contents
About the Document ................................................................................................................................ 2
Contents .................................................................................................................................................... 3
Table Index ............................................................................................................................................... 4
1 Introduction ....................................................................................................................................... 5
2 Debug ................................................................................................................................................. 6
2.1. Related Code Files and Location .......................................................................................... 6
2.2. Debug ................................................................................................................................... 6
3 Compile and Download................................................................................................................... 11
4 Charge .............................................................................................................................................. 12
4.1. Charging Process ............................................................................................................... 12
4.2. Set Power-on/off Voltage .................................................................................................... 12
4.3. The Maximum Charging Time ............................................................................................. 14
4.4. Abnormality ......................................................................................................................... 14
4.5. Query Device Information ................................................................................................... 14
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 4 / 14
Table Index
TABLE 1: RELATED CODE FILES AND LOCATIONS ........................................................................................ 6
TABLE 2: BATTERY-TEMPERATURE MONITORING CALCULATIONS ......................................................... 10
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 5 / 14
1 Introduction
This document mainly describes debug codes for charging on Quectel SC20 module, which will help
customer to better understand the charging process.
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 6 / 14
2 Debug
2.1. Related Code Files and Location
Table 1: Related Code Files and Locations
Linux power_supply standard architecture enables power management on Android OS and data can be
sent to user space through Uevent mechanism.
2.2. Debug
Device Registration
The code for device registration is as follows:
static int qpnp_lbc_main_probe(struct spmi_device *spmi)
{
xxx
rc = power_supply_register(chip->dev, &chip->batt_psy); //Device registration
xxx
}
Code Files and Locations
Description
android/kernel/drivers/power/qpnp-linear-charger.c
Driver file for charging
android/kernel/arch/arm/boot/dts/qcom/batterydata-
palladium.dtsi
Battery parameters
android/kernel/arch/arm/boot/dts/qcom/msm-pm890
9.dtsi
Charging parameters
android/kernel/arch/arm/boot/dts/qcom/msm8909-p
m8909-mtp.dtsi
Charging switch
android/kernel/drivers/hwmon/qpnp-adc-common.c
Thermistor voltage and temperature table
qpnp-linear-charger.c
Driver file for charging, it is about device
registration, DTS parse, charging controlling, etc.
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 7 / 14
static int qpnp_lbc_probe(struct spmi_device *spmi)
{
if (is_parallel_charger(spmi))
return qpnp_lbc_parallel_probe(spmi);
else
return qpnp_lbc_main_probe(spmi);
}
static int __init qpnp_lbc_init(void)
{
return spmi_driver_register(&qpnp_lbc_driver);
}
module_init(qpnp_lbc_init);
static void __exit qpnp_lbc_exit(void)
{
spmi_driver_unregister(&qpnp_lbc_driver);
}
module_exit(qpnp_lbc_exit);
MODULE_DESCRIPTION("QPNP Linear charger driver");
MODULE_LICENSE("GPL v2");
DTS Parse
DTS (Device Tree Source) is parsed by probe function.
static int qpnp_charger_read_dt_props(struct qpnp_lbc_chip *chip)
{
xxx
xxx
}
Charging Controlling
e.g.: when the battery temperature changes, charging current will become smaller to protect battery.
Please refer to the following code:
static void qpnp_lbc_set_appropriate_current(struct qpnp_lbc_chip *chip)
{
unsigned int chg_current = chip->usb_psy_ma;
if (chip->bat_is_cool && chip->cfg_cool_bat_chg_ma)
chg_current = min(chg_current, chip->cfg_cool_bat_chg_ma);
if (chip->bat_is_warm && chip->cfg_warm_bat_chg_ma)
chg_current = min(chg_current, chip->cfg_warm_bat_chg_ma);
if (chip->therm_lvl_sel != 0 && chip->thermal_mitigation)
chg_current = min(chg_current,
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 8 / 14
chip->thermal_mitigation[chip->therm_lvl_sel]);
pr_debug("setting charger current %d mA\n", chg_current);
qpnp_lbc_ibatmax_set(chip, chg_current);
}
Battery Parameters
Battery parameters can be configured to calculate battery capacity, such as OCV (Open Circuit Voltage)
under different temperature and battery percentage.
qcom,pc-temp-ocv-lut{
xxx
}
Charging Parameters
Charging parameters includes high temperature percentage, low temperature percentage, battery cooling
threshold, battery warming threshold, charging current, etc., as shown below:
pm8909_chg: qcom,charger{
xxx
qcom,batt-hot-percentage = <35>; //High temperature percentage
qcom,batt-cold-percentage = <70>; //Low temperature percentage
qcom,cool-bat-decidegc = <100>; //Cooling threshold
qcom,warm-bat-decidegc = <450>; //Warming threshold
qcom,ibatmax-warm-ma = <360>; //Cooling current
qcom,ibatmax-cool-ma = <360>; //Warming current
xxx
}
Charging Switch
SC20 applies PMU internal charging and IC is pm8909, so customer needs to turn on pm8909 charger IC,
as follows:
&pm8909_chg {
status = "ok";
/* qcom,charging-disabled; */ //Comment out this line.
};
Thermistor Voltage and Temperature Table:
Thermistor voltage and temperature table is used to judge the accuracy of battery temperature that is
read.
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 9 / 14
static const struct qpnp_vadc_map_pt adcmap_btm_threshold[] = {
{XXX, YYY}, //The former is the temperature value, and the latter is the voltage
}
The table is customized, it needs hardware engineers to get values from battery vendors and fill in.
High Temperature Shutdown
High temperature protection has been enabled on SC20, when the battery temperature is above 68
degrees, it will automatically shut down.
High temperature shutdown related files and codes are presented as follows:
1. android/frameworks/base/services/core/java/com/android/server/BatteryService.java: for executing
shutdown action.
private void shutdownIfOverTempLocked() {
//Shut down gracefully if temperature is too high (>68°C by default)
//Wait until the system has booted before attempting to display the shutdown dialog.
if (mBatteryProps.batteryTemperature > mShutdownBatteryTemperature) {
mHandler.post(new Runnable() {
@Override
public void run() {
if (ActivityManagerNative.isSystemReady()) {
Slog.e(TAG, "silent_reboot shutdownIfOverTempLocked");
Intent intent = new Intent(Intent.ACTION_REQUEST_SHUTDOWN);
intent.putExtra(Intent.EXTRA_KEY_CONFIRM, false);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivityAsUser(intent, UserHandle.CURRENT);
}
}
});
}
}
2. android/frameworks/base/core/res/res/values/config.xml: set the temperature that triggers shutdown.
<!-- Shutdown if the battery temperature exceeds (this value * 0.1) Celsius. -->
<integer name="config_shutdownBatteryTemperature">680</integer>
If module shuts down immediately after being turned on, customer should first make sure that the battery
has power, then check whether it is caused by high temperature or not.
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 10 / 14
High and Low Temperature Thresholds
High and low temperature thresholds are determined by both software and hardware, and hardware plays
a major role. On hardware side, the thresholds are closely related to thermistor and voltage divider
resistor of battery. On software side, customer only needs to choose the percentage from BTM
comparator of PM8909, which are listed as below, and calculate the thresholds by the following formula.
Table 2: Battery-temperature Monitoring Calculations
PM8909 internal comparator (pointed out by red arrow) is shown as below:
Figure 1: PM8909 Internal Comparator
BTM Comparator Thresholds
Minimum Resistor Values
70% to 35%
R_S1 = 39×(R_cold R_hot)/70
R_S2 = (3×R_cold 13×R_hot)/10
80% to 25%
R_S1 = 3×(R_cold R_hot)/11
R_S2 = (R_cold 12×R_hot)/11
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 11 / 14
3 Compile and Download
After debugging, customer needs to compile kernel and download kernel images.
1. Compile Kernel
make jn bootimage(“n” means the thread numbers of CPU)
2. Download Kernel Images by Fastboot
adb reboot bootloader
fastboot flash boot android\out\target\product\msm8909\boot.img
fastboot reboot
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 12 / 14
4 Charge
4.1. Charging Process
Charging processes consists of four stages: trickle charging, constant current charging, constant voltage
charging and charging termination.
1. Trickle Charging
When battery voltage is lower than 3.2V, it is called trickle charging stage. This stage can be divided into
two phases: when battery voltage is lower than 2.8V, it is in first phase, and the current is 90mA. When
the voltage is greater than 2.8V and less than 3.2V, it is in the second phase, and the current is 450mA. In
trickle charging , it is the hardware that controls the charging behavior.
2. Constant Current Charging
The software system has been booted up in this stage, and it controls the charging behavior. The USB
charging current is 450mA and AC charging current is 1440mA.
3. Constant Voltage Charging
This stage begins when the battery voltage reaches VDD.
4. Charging Termination
Since pm8909 does not have ADC to detect current, so it is based on the battery capacity to judge the
charging status. When the value is100%, it indicates the charging is ended.
4.2. Set Power-on/off Voltage
Customer can set power-on voltage in boot_images\core\systemdrivers\pmic\config\msm8909\pm8909\
pm_config_target.c.
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 13 / 14
In chg_app_ds array, 3500 indicates the power-on voltage is 3.5V. Customer can edit the value to change
the voltage.
Set power-off voltage setting in android\kernel\arch\arm\boot\dts\qcom\batterydata-palladium.dtsi.
In the palladium-battery data node, 3300000 indicates the voltage is 3.3V. Customer can edit the value to
change the voltage.
Quectel
Confidential
LTE Module Series
SC20 Charging User Guide
SC20_Charging_User_Guide Confidential / Released 14 / 14
4.3. The Maximum Charging Time
A timer can be enabled in the driver files according to the configuration in DTS (qcom, tchg-mins). When
charging timer reaches the set time, the module will stop charging.
Set timer as follows:
static int qpnp_lbc_tchg_max_set(struct qpnp_lbc_chip *chip, int minutes)
{
xxx
/* Enable timer */
rc = qpnp_lbc_masked_write(chip, chip->chgr_base + CHG_TCHG_MAX_EN_REG,
CHG_TCHG_MAX_EN_BIT, CHG_TCHG_MAX_EN_BIT);
if (rc) {
pr_err("Failed to write tchg_max_en rc=%d\n", rc);
return rc;
}
return rc;
}
4.4. Abnormality
When the battery temperature crosses high temperature threshold or low temperature threshold, it will
stop charging.
4.5. Query Device Information
You can query battery temp/capacity /health information via adb tool, for example:
adb root
adb remount
adb shell
cat /sys/class/power_supply/battery/temp //Query battery temperature
cat /sys/class/power_supply/battery/capacity //Query battery capacity
cat /sys/class/power_supply/battery/health //Query battery status
cat /sys/class/power_supply/battery/ voltage_now //Query battery voltage
Quectel
Confidential
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15

Quectel LTE Module Series Charging User Manual

Type
Charging User Manual
This manual is also suitable for

Quectel LTE Module Series is a high-performance and versatile module series that supports a wide range of applications, including IoT, industrial automation, and mobile computing. With its compact size and low power consumption, the Quectel LTE Module Series is ideal for devices that require high performance and long battery life.

The Quectel LTE Module Series supports a variety of connectivity options, including LTE-FDD, LTE-TDD, and WCDMA. This makes it easy to connect to networks in a variety of locations, ensuring that your device can stay connected even in remote areas.

The Quectel LTE Module Series also supports a variety of features that make it easy to develop and deploy IoT applications. These features include:

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI