CN102360065B - Battery detection method and device - Google Patents

Battery detection method and device Download PDF

Info

Publication number
CN102360065B
CN102360065B CN201110236688.XA CN201110236688A CN102360065B CN 102360065 B CN102360065 B CN 102360065B CN 201110236688 A CN201110236688 A CN 201110236688A CN 102360065 B CN102360065 B CN 102360065B
Authority
CN
China
Prior art keywords
battery
efferent
universal input
gpio
voltage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201110236688.XA
Other languages
Chinese (zh)
Other versions
CN102360065A (en
Inventor
杨金华
顾军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shengxia Intellectual Property Operation Co ltd
Yancheng Ruijia Automobile Service Co ltd
Original Assignee
Huizhou TCL Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN201110236688.XA priority Critical patent/CN102360065B/en
Publication of CN102360065A publication Critical patent/CN102360065A/en
Application granted granted Critical
Publication of CN102360065B publication Critical patent/CN102360065B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Secondary Cells (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)
  • Tests Of Electric Status Of Batteries (AREA)

Abstract

The invention discloses a battery detection method and device. The detection method comprises the following steps of: obtaining a voltage value produced by an internal resistor in a battery via a pin ID of the battery when a general purpose input/output (GPIO) part is a high level after a mobile terminal is started up or charged; detecting whether the battery is a legal battery or not according to a comparison result of the obtained voltage value and a preset threshold; and setting the GPIO part to a low level when the detection is finished. Correspondingly, the invention also provides a battery detection device. Through the above technical scheme, the electricity-saving effect can be fulfilled while the detection of the battery is finished.

Description

A kind of battery detection method and device
Technical field
The present invention relates to communication technical field, particularly relate to a kind of battery detection method and device.
Background technology
In the use procedure of mobile terminal, battery is part and parcel very.In order to prevent that mobile terminal from being used illegal battery, generally all can detect the battery of mobile terminal.Battery on mobile terminal all can arrange one for detection of the ID pin of battery at present, one of them effect of this pin is when mobile terminal charges, to detect mobile terminal whether to use legal battery, and another effect is whether in when start, detect battery legal.
In prior art, when mobile terminal charges, the baseband chip of mobile terminal can detect the ID pin of battery always, avoids user in charging process to pull up battery.And while not charging, the general ID pin that only need to detect battery in start process, need not continue after start to detect again.This is that mobile terminal also will shut down because user pulls up after battery, follow-up after battery insertion charger, just needs to detect the ID pin of battery again.
As shown in Figure 1, be the testing circuit schematic diagram of prior art.In this detection method, the power supply AVDD (analog operation voltage) of power management chip output can not close, after mobile terminal-opening, AVDD is by resistance R 1, through the ID resistance R in battery, be transferred to underground again, therefore AVDD is by this path generation current, and this size of current depends on the size of R1, R.Whether the baseband chip of mobile terminal detects the magnitude of voltage in resistance R by ADC_ID and is input to ADC (mould/number conversion) module of baseband chip, according to this battery that relatively comes to determine of this magnitude of voltage and threshold value, be legal battery.Threshold value is generally arranged by each producer oneself.
Inventor's discovery, the ID pin that really need to detect battery is that other times do not need to detect when charging and start.Owing to not needing to detect, AVDD still equally can pass through R1, R and form unnecessary electric current, has produced power consumption, although only less than the power consumption of 0.2mA, but during for mobile terminal standby, only there is the average current of 1.5mA left and right, for the minimum current of 0.8mA, be very large electric leakage.
Therefore, existing detection method is brought the defect of unnecessary power consumption.
Summary of the invention
The technical matters that the present invention mainly solves is to provide a kind of battery detection method and device, can when completing battery detecting, realize the effect of power saving.
The invention provides a kind of battery detection method, comprising:
When mobile terminal-opening or when charging, the magnitude of voltage that when universal input/efferent GPIO that the ID pin by battery obtains at baseband chip is high level, the internal resistance of battery produces;
Whether according to the comparative result of the described magnitude of voltage obtaining and predetermined threshold value, detect described battery is legal battery;
After described detection completes, described universal input/efferent is set to low level.
Preferably, the described ID pin by battery obtains the magnitude of voltage that the resistance in battery produces when universal input/efferent GPIO is high level and is specially:
Described universal input/efferent output high level provides power supply;
Between described universal input/efferent and battery, have the first resistance, the voltage that the internal resistance of described battery and described the first resistance produce the electric current between described universal input/efferent and ground carries out dividing potential drop;
ID pin by battery obtains the magnitude of voltage that the internal resistance of described battery produces.
Preferably, specifically by the baseband chip of mobile terminal, the ID pin by battery obtains the magnitude of voltage that the internal resistance of battery when universal input/efferent GPIO is high level produces.
Preferably, described universal input/efferent GPIO is the GPIO that one of them acquiescence in described baseband chip is output as high level
Preferably, describedly described universal input/efferent be set to low level comprise:
By being set, the register realization that described universal input/efferent is corresponding is set to low level.
The present invention also provides a kind of battery check device, comprising:
Universal input/the efferent of baseband chip, for exporting high level;
Test section, for when mobile terminal-opening or when charging, the ID pin by battery obtains the magnitude of voltage that the internal resistance of battery when universal input/efferent GPIO is high level produces; Whether according to the comparative result of the described magnitude of voltage obtaining and predetermined threshold value, detect described battery is legal battery;
Control part, after completing when described detection, is set to low level by described universal input/efferent.
Preferably, have the first resistance between described universal input/efferent and battery, the voltage that the internal resistance of described battery and described the first resistance produce the electric current between described universal input/efferent and ground carries out dividing potential drop;
The ID pin of described test section by battery obtains the magnitude of voltage that the internal resistance of described battery produces.
Preferably, described universal input/efferent GPIO is the GPIO that one of them acquiescence in baseband chip is output as high level.
Preferably, described control part is set to low level by the register realization that described universal input/efferent is corresponding is set.
Technique scheme can find out, the present invention has following beneficial effect:
The present invention is by adopting universal input/efferent GPIO to replace AVDD of the prior art to export high level as power supply, so after having detected, for example, while not needing to detect battery ID again after start, by universal input/efferent is set to low level, just can be so that generation current no longer in testing circuit, thereby can not produce power consumption, realize the object of power saving, and not increase cost.
Accompanying drawing explanation
Fig. 1 is the testing circuit schematic diagram of prior art;
Fig. 2 is detection method process flow diagram of the present invention;
Fig. 3 is testing circuit schematic diagram of the present invention;
Fig. 4 is the concrete testing circuit schematic diagram of the present invention;
Fig. 5 is apparatus structure schematic diagram of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making all other embodiment that obtain under creative work prerequisite, belong to the scope of protection of the invention.
The invention provides a kind of battery detection method, can when completing battery detecting, realize the effect of power saving.
In prior art, the power supply AVDD of power management chip output does not close, by resistance R 1, ID resistance R (inside battery resistance) generation current.The current value that different mobile terminals produces is different, for example the general electric current that produces 0.1mA to 0.2mA on the mobile terminal of the MTK of MediaTek Inc. platform.Owing to not needing to detect battery ID, AVDD still equally can pass through R1, R and produce unnecessary electric current, has caused power consumption.
In order to address this problem, the way that the present invention considers is this power supply AVDD to be closed while not needing to detect, and opens this power supply while needing again.Yet this power supply is can not be pent on mobile terminal, because this power supply is the power supply that acquiescence is opened, closing rear mobile terminal can shut down, and this power supply need select power management chip to give tacit consent to the power supply of opening, if select one not to be the power supply that acquiescence is opened, that ID that cannot carry out battery when just startup and shutdown charging detects.Therefore, the present invention considers the power supply of selecting universal input/efferent GPIO (General Purpose Input Output) to replace AVDD to detect as battery ID, thereby overcomes the defect of prior art.
Fig. 2 is detection method process flow diagram of the present invention.
As shown in Figure 2, detection method of the present invention comprises:
Step 201, when mobile terminal-opening or when charging, the ID pin by battery obtains the magnitude of voltage that the internal resistance of battery when universal input/efferent GPIO is high level produces;
This step is specially:
Universal input/efferent output high level provides power supply;
Between universal input/efferent and battery, have the first resistance, the voltage that the internal resistance of described battery and described the first resistance produce the electric current between described universal input/efferent and ground carries out dividing potential drop;
ID pin by battery obtains the magnitude of voltage that the internal resistance of described battery produces.
Concrete, this step is the baseband chip by mobile terminal, and the ID pin by battery obtains the magnitude of voltage that the internal resistance of battery when universal input/efferent GPIO is high level produces.
In addition, universal input/efferent GPIO is the GPIO that one of them acquiescence in described baseband chip is output as high level.
Whether the magnitude of voltage obtaining described in step 202, basis and the comparative result of predetermined threshold value detect described battery is legal battery;
Predetermined threshold value in this step, is according to circumstances arranged by producer.
Step 203, after described detection completes, described universal input/efferent is set to low level.
This step is specially: by the register realization that described universal input/efferent is corresponding is set, be set to low level.
Can find, the present invention is by adopting universal input/efferent GPIO to replace AVDD of the prior art to export high level as power supply, so after having detected, for example, while not needing to detect battery ID again after start, by universal input/efferent is set to low level, just can be so that generation current no longer in testing circuit, thus can not produce power consumption, realize the object of power saving, and do not increase cost.
Referring to Fig. 3, is testing circuit schematic diagram of the present invention.
As shown in Figure 3, figure comprises that battery connector, GPIO, resistance R 1, inside battery resistance are ID resistance R, ADC_ID.From GPIO, through resistance R 1, resistance R, be connected to ground, form a path, when GPIO is high level, generation current in path, resistance R produces dividing potential drop to voltage, whether by ADC_ID, can detect the magnitude of voltage in resistance R, be legal battery according to this battery of relatively can determining of this magnitude of voltage and threshold value.
Compare with Fig. 1 scheme of prior art, the present invention adopts GPIO to replace AVDD as power supply, and is all high level.
Because the electric current that in prior art, AVDD provides at testing circuit is also little, the electric current that is less than 1mA, and the GPIO of baseband chip generally can provide the electric current of 8mA, therefore from the ability of source current, consider, can consider the power supply that adopts GPIO to replace AVDD to detect as battery ID.
In baseband chip due to mobile terminal, there is the high level voltage of a lot of GPIO the same with the voltage of AVDD, and for the power supply of GPIO power supply is also the power supply that power management chip acquiescence is opened, therefore can consider for replacing AVDD, just when selecting, need to select acquiescence to be output as the GPIO of high level.That is to say, during just startup and shutdown charging, the GPIO that is output as high level can provide an effective Power supply pond ID to detect and use, and in fact such GPIO has much available in most baseband chip, MTK6235 for example, the MTK platform baseband chip of MTK6516 model etc.
The GPIO that the present invention adopts acquiescence to be output as high level replaces AVDD power supply, while not needing to detect battery ID more so after start, only GPIO need to be output as to low level.Concrete, by software, the register that this GPIO is corresponding is set and just can realizes and be set to low level.Processing through such, just makes just to no longer include current drain on resistance R 1, R, also just reduces power consumption, realizes power saving.
Fig. 4 is the concrete testing circuit schematic diagram of the present invention.
Fig. 4 compares with Fig. 3, has increased the connection of base chip.In figure, AUX_IN is the ADC input pin of baseband chip.The GPIO of baseband chip selects an acquiescence to be output as the GPIO of high level, and its high level voltage and AVDD have same voltage.When mobile terminal inserts charger charging and start, the power supply opening that the power management chip of mobile terminal is opened acquiescence, after having power supply output, GPIO has also exported high level, for battery ID detects, provides power supply.
Baseband chip detects the magnitude of voltage in resistance R by ADC_ID, according to this magnitude of voltage and predefined threshold value, just can judge whether this battery is legal battery.For example, when this magnitude of voltage is greater than threshold value, think that this battery is illegal battery.If while there is no battery, the magnitude of voltage detecting by ADC_ID is by the magnitude of voltage that is GPIO.
It should be noted that, said threshold value, is generally that each producer oneself arranges here, and the battery of mobile terminal generally all unifies there is ID resistance, but the value of this resistance also can be arranged by each producer.
When not needing to detect battery ID again, by software, the register that this GPIO is corresponding is set, GPIO is output as to low level, make no longer generation current of testing circuit, thereby realize power saving.
Above-mentionedly describe method of the present invention in detail, corresponding, the invention provides a kind of battery check device.
Fig. 5 is apparatus structure schematic diagram of the present invention.
As shown in Figure 5, battery check device comprises: universal input/efferent 501, test section 502, control part 503.
Universal input/efferent 501, for exporting high level;
Test section 502, for when mobile terminal-opening or when charging, the ID pin by battery obtains the magnitude of voltage that the internal resistance of battery when universal input/efferent 501GPIO is high level produces; Whether according to the comparative result of the described magnitude of voltage obtaining and predetermined threshold value, detect described battery is legal battery;
Control part 503, after completing when described detection, is set to low level by described universal input/efferent 501.
Between described universal input/efferent 501 and battery, have the first resistance, the voltage that the internal resistance of described battery and described the first resistance produce the electric current between described universal input/efferent 501 and ground carries out dividing potential drop;
The ID pin of described test section 502 by battery obtains the magnitude of voltage that the internal resistance of described battery produces.
Described universal input/efferent 501GPIO is the GPIO that one of them acquiescence in baseband chip is output as high level.
Described control part 503 is set to low level by the register realization of described universal input/efferent 501 correspondences is set.
In sum, the present invention is by adopting universal input/efferent GPIO to replace AVDD of the prior art to export high level as power supply, so after having detected, for example, while not needing to detect battery ID again after start, by universal input/efferent is set to low level, just can be so that generation current no longer in testing circuit, thus can not produce power consumption, realize the object of power saving, and do not increase cost.
The foregoing is only embodiments of the invention; not thereby limit the scope of the claims of the present invention; every equivalent structure or conversion of equivalent flow process that utilizes instructions of the present invention and accompanying drawing content to do; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.

Claims (9)

1. a battery detection method, is characterized in that, comprising:
When mobile terminal-opening or when charging, the magnitude of voltage that when universal input/efferent GPIO that the ID pin by battery obtains at baseband chip is high level, the internal resistance of battery produces;
Whether according to the comparative result of the described magnitude of voltage obtaining and predetermined threshold value, detect described battery is legal battery;
After described detection completes, described universal input/efferent is set to low level.
2. method according to claim 1, is characterized in that:
The described ID pin by battery obtains the magnitude of voltage that the resistance in battery produces when universal input/efferent GPIO is high level and is specially:
Described universal input/efferent output high level provides power supply;
Between described universal input/efferent and battery, have the first resistance, the voltage that the internal resistance of described battery and described the first resistance produce the electric current between described universal input/efferent and ground carries out dividing potential drop;
ID pin by battery obtains the magnitude of voltage that the internal resistance of described battery produces.
3. method according to claim 1 and 2, is characterized in that:
Specifically by the baseband chip of mobile terminal, the ID pin by battery obtains the magnitude of voltage that the internal resistance of battery when universal input/efferent GPIO is high level produces.
4. method according to claim 3, is characterized in that:
Described universal input/efferent GPIO is the GPIO that one of them acquiescence in described baseband chip is output as high level.
5. method according to claim 1 and 2, is characterized in that:
Describedly described universal input/efferent be set to low level comprise:
By being set, the register realization that described universal input/efferent is corresponding is set to low level.
6. a battery check device, is characterized in that, comprising:
Universal input/the efferent of baseband chip, for exporting high level;
Test section, for when mobile terminal-opening or when charging, the ID pin by battery obtains the magnitude of voltage that the internal resistance of battery when universal input/efferent GPIO is high level produces; Whether according to the comparative result of the described magnitude of voltage obtaining and predetermined threshold value, detect described battery is legal battery;
Control part, after completing when described detection, is set to low level by described universal input/efferent.
7. device according to claim 6, is characterized in that:
Between described universal input/efferent and battery, have the first resistance, the voltage that the internal resistance of described battery and described the first resistance produce the electric current between described universal input/efferent and ground carries out dividing potential drop;
The ID pin of described test section by battery obtains the magnitude of voltage that the internal resistance of described battery produces.
8. according to the device described in claim 6 or 7, it is characterized in that:
Described universal input/efferent GPIO is the GPIO that one of them acquiescence in baseband chip is output as high level.
9. according to the device described in claim 6 or 7, it is characterized in that:
Described control part is set to low level by the register realization that described universal input/efferent is corresponding is set.
CN201110236688.XA 2011-08-17 2011-08-17 Battery detection method and device Active CN102360065B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110236688.XA CN102360065B (en) 2011-08-17 2011-08-17 Battery detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110236688.XA CN102360065B (en) 2011-08-17 2011-08-17 Battery detection method and device

Publications (2)

Publication Number Publication Date
CN102360065A CN102360065A (en) 2012-02-22
CN102360065B true CN102360065B (en) 2014-10-29

Family

ID=45585426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110236688.XA Active CN102360065B (en) 2011-08-17 2011-08-17 Battery detection method and device

Country Status (1)

Country Link
CN (1) CN102360065B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9035872B2 (en) * 2012-06-08 2015-05-19 Apple Inc. Detection system and method between accessory and electronic device
CN105376420B (en) * 2014-08-29 2019-07-23 展讯通信(上海)有限公司 Save the system and method for SIM card sleep state power consumption
CN106324516A (en) * 2016-08-29 2017-01-11 苏州意可达电子有限公司 Mobile phone battery recycling method
CN109507593A (en) * 2018-12-21 2019-03-22 惠州Tcl移动通信有限公司 Enabled method, relevant apparatus and the storage medium of battery of mobile terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1858963A (en) * 2005-04-30 2006-11-08 华为技术有限公司 Cell phone charging circuit and charging method
CN101470173A (en) * 2007-12-29 2009-07-01 鸿富锦精密工业(深圳)有限公司 Battery detection apparatus and method
CN101488589A (en) * 2008-01-15 2009-07-22 宏达国际电子股份有限公司 Battery assembly and charging state measurement method
CN201303364Y (en) * 2008-04-22 2009-09-02 中兴通讯股份有限公司 Temperature monitoring module of mobile terminal battery and high-temperature monitoring circuit of mobile terminal battery

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004138588A (en) * 2002-10-21 2004-05-13 Matsushita Electric Ind Co Ltd Battery residual capacity indicator and mobile terminal
JP4043977B2 (en) * 2003-03-11 2008-02-06 株式会社日本自動車部品総合研究所 Secondary battery internal resistance detection device and internal resistance detection method
CN101645715B (en) * 2009-08-25 2013-08-07 中兴通讯股份有限公司 Terminal power saving method and terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1858963A (en) * 2005-04-30 2006-11-08 华为技术有限公司 Cell phone charging circuit and charging method
CN101470173A (en) * 2007-12-29 2009-07-01 鸿富锦精密工业(深圳)有限公司 Battery detection apparatus and method
CN101488589A (en) * 2008-01-15 2009-07-22 宏达国际电子股份有限公司 Battery assembly and charging state measurement method
CN201303364Y (en) * 2008-04-22 2009-09-02 中兴通讯股份有限公司 Temperature monitoring module of mobile terminal battery and high-temperature monitoring circuit of mobile terminal battery

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JP特开2004-138588A 2004.05.13
JP特来2004-271445A 2004.09.30

Also Published As

Publication number Publication date
CN102360065A (en) 2012-02-22

Similar Documents

Publication Publication Date Title
CN101304568B (en) Apparatus and method for charging mobile terminal
CN103064489B (en) A kind of method and terminal of carrying out internal circuit selection according to USB interface state
CN105449757B (en) Prevent the method and device that adapter or portable power source disconnect in charging process
CN103683348B (en) There is the electronic installation of power consumption detecting function
CN102360065B (en) Battery detection method and device
CN110221163A (en) A kind of the connecting detection method and detection circuit of USB Type-C interface
CN101924383A (en) Mobile terminal of automatically setting charging current and implementation method thereof
CN204068306U (en) A kind of charging system of electronic product
CN103391362B (en) A kind of application class method based on power consumption and mobile terminal
CN103344863A (en) Mobile terminal testing method and mobile terminal testing system
CN104410116A (en) Quick charging device and quick charging method
CN104795864B (en) A kind of mobile terminal and charged state detection method of accurate detection charged state
CN103616551B (en) The terminal and cell voltage acquisition methods of cell voltage can be accurately obtained when charging
CN105375544A (en) Low-battery battery charging method and power management integrated circuit
CN104765396A (en) Mobile terminal based shutdown voltage dynamic adjusting method and system
CN105891736A (en) QC2.0 fast charge detection circuit and detection method
CN109217425A (en) A kind of charger circuit and its intelligent charge control method
CN106329630A (en) Charging method and device
CN202798035U (en) Charging mode detection circuit and mobile terminal
CN103633719B (en) A kind of charging system and charge control method thereof
CN202906503U (en) Control device for mobile power supply and mobile charging power supply
CN106300549A (en) Electronic installation and charging method thereof
CN104842895B (en) Power transfer device and method, car-mounted terminal and vehicle
CN105896645A (en) Charging function detection method, apparatus, and system for mobile terminal
CN103905645B (en) Mobile terminal and its closedown method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201229

Address after: 224000 No.6 Xinhua Road, Yandu District, Yancheng City, Jiangsu Province

Patentee after: Yancheng Ruijia Automobile Service Co.,Ltd.

Address before: 510000 No. 106 Fengze East Road, Nansha District, Guangzhou City, Guangdong Province

Patentee before: Guangzhou shengxia Intellectual Property Operation Co.,Ltd.

Effective date of registration: 20201229

Address after: 510000 No. 106 Fengze East Road, Nansha District, Guangzhou City, Guangdong Province

Patentee after: Guangzhou shengxia Intellectual Property Operation Co.,Ltd.

Address before: 516006 Guangdong province Huizhou Zhongkai hi tech Development Zone No. 23 District

Patentee before: HUIZHOU TCL MOBILE COMMUNICATION Co.,Ltd.