Disclosure of Invention
The embodiment of the invention aims to provide a power supply method and a power supply device for a terminal, which are used for solving the problem that power cannot be supplied to the terminal when different mainboards and different types of batteries are mixed and inserted or when no battery is accessed in the prior art.
In order to solve the technical problem, the embodiment of the application adopts the following technical scheme: a terminal power supply method comprises the following steps:
the first control chip outputs a plurality of initial first register values and a plurality of initial second register values to the second control chip and detects whether a battery is accessed;
when the first control chip detects that a battery is accessed, the first control chip determines a plurality of first register values according to the type of the battery and outputs the first register values to the second control chip so as to cover the initial first register values; enabling the second control chip to determine a plurality of second register values according to the type of the battery and cover the plurality of initial second register values; the second control chip respectively adjusts the power parameters of the battery and the power supply parameters of the terminal according to the first register values and the second register values so as to meet the power supply requirement of the terminal;
and when the first control chip detects that no battery is accessed, the second control chip adjusts the power supply parameters of the terminal according to the initial first register values and the initial second register values so as to meet the power supply requirement of the terminal.
Optionally, when the first control chip detects that a battery is accessed, the first control chip determines a plurality of first register values according to the type of the battery, and specifically includes:
when the first control chip detects that a battery is accessed, the first control chip and the battery establish a communication relation according to a first communication protocol;
the first control chip identifies the type of the battery to determine the string number of the battery;
and the first control chip determines a plurality of first register values according to the string number of the battery.
Optionally, after the first control chip determines a plurality of first register values according to the type of the battery, and outputs the plurality of first register values to the second control chip to cover the plurality of initial first register values, the method further includes: the first control chip outputs a battery access signal to the second control chip so that the second control chip identifies the type of the battery to determine the string number of the battery, and the second control chip determines a plurality of second register values according to the string number of the battery.
Optionally, the first control chip outputs a plurality of initial first register values and a plurality of initial second register values to the second control chip, and specifically includes:
determining a plurality of initial first register values and a plurality of initial second register values according to a preset battery type;
and outputting the initial first register values and the initial second register values to a second control chip.
Optionally, after the first control chip establishes a communication relationship with the battery according to a first communication protocol, when the first control chip cannot communicate with the battery, the method further includes: charging the battery with a predetermined current.
Optionally: the first control chip detects whether the power adapter is connected or disconnected, and if the power adapter is detected to be connected or disconnected, the register value in the second control chip is kept unchanged.
Optionally, the first control chip detects whether the battery is pulled out, and if the battery is pulled out, the first control chip outputs a plurality of initial first register values and a plurality of initial second register values to the second control chip to cover the plurality of first register values and the plurality of second register values in the second control chip.
Optionally, the first control chip is a control chip EC; the second control chip is a charging IC.
In order to solve the technical problem, the invention also discloses a terminal power supply device, which comprises a first control chip and a second control chip, wherein the first control chip is in communication connection with the second control chip;
the first control chip is used for outputting a plurality of initial first register values and a plurality of initial second register values to the second control chip and detecting whether a battery is accessed;
when the first control chip detects that a battery is accessed, the first control chip is used for determining a plurality of first register values according to the type of the battery and outputting the first register values to the second control chip so as to cover the initial first register values; enabling the second control chip to determine a plurality of second register values according to the type of the battery and cover the plurality of initial second register values; the second control chip is used for adjusting the power parameters of the battery and the power supply parameters of the terminal according to the first register values and the second register values so as to meet the power supply requirement of the terminal;
and when the first control chip detects that no battery is accessed, the second control chip is used for adjusting the power supply parameters of the terminal according to the plurality of initial first register values and the plurality of initial second register values so as to meet the power supply requirement of the terminal.
Optionally, when the first control chip detects that a battery is accessed, the first control chip is configured to determine a plurality of first register values according to a type of the battery, and specifically includes:
when the first control chip detects that the battery is accessed, the first control chip is used for establishing a communication relation with the battery according to a first communication protocol;
the first control chip is used for identifying the type of the battery so as to determine the string number of the battery;
the first control chip is used for determining a plurality of first register values according to the string number of the battery.
Optionally, after the first control chip determines a plurality of first register values according to the type of the battery and outputs the plurality of first register values to the second control chip to cover the plurality of initial first register values, the first control chip is further configured to output a battery access signal to the second control chip, so that the second control chip identifies the type of the battery to determine the number of strings of the battery, and the second control chip determines a plurality of second register values according to the number of strings of the battery.
Optionally, when the first control chip is configured to output a plurality of initial first register values and a plurality of initial second register values to the second control chip, the first control chip is specifically configured to:
the first control chip is used for determining a plurality of initial first register values and a plurality of initial second register values according to a preset battery type;
the first control chip is used for outputting the initial first register values and the initial second register values to the second control chip.
Optionally, after the first control chip establishes a communication relationship with the battery according to the first communication protocol, when the first control chip cannot communicate with the battery, the first control chip is further configured to charge the battery by using a predetermined current.
Optionally, the first control chip is further configured to detect whether a power adapter is connected or disconnected, and if it is detected that a power adapter is connected or disconnected, the register value in the second control chip is kept unchanged.
Optionally, the first control chip is further configured to detect whether a battery is pulled out, and if the battery is pulled out, the first control chip is configured to output a plurality of initial first register values and a plurality of initial second register values to the second control chip to cover the plurality of first register values and the plurality of second register values in the second control chip.
Optionally, the first control chip is a control chip EC; the second control chip is a charging IC.
The embodiment of the invention has the beneficial effects that: when a battery is accessed, the power parameters of the battery and the power supply parameters of the terminal are adjusted according to different battery types, so that the power supply requirement of the terminal can be met even under the condition that the battery is inserted in a mixed manner; when no battery is connected, the power supply parameters of the terminal are adjusted according to the preset values, so that the power supply requirement of the terminal is met, and the power supply requirement of the terminal can be met under different conditions.
Detailed Description
Various aspects and features of the present application are described herein with reference to the drawings.
It will be understood that various modifications may be made to the embodiments of the present application. Accordingly, the foregoing description should not be construed as limiting, but merely as exemplifications of embodiments. Those skilled in the art will envision other modifications within the scope and spirit of the application.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and, together with a general description of the application given above and the detailed description of the embodiments given below, serve to explain the principles of the application.
These and other characteristics of the present application will become apparent from the following description of preferred forms of embodiment, given as non-limiting examples, with reference to the attached drawings.
It should also be understood that, although the present application has been described with reference to some specific examples, a person of skill in the art shall certainly be able to achieve many other equivalent forms of application, having the characteristics as set forth in the claims and hence all coming within the field of protection defined thereby.
The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely exemplary of the application, which can be embodied in various forms. Well-known and/or repeated functions and constructions are not described in detail to avoid obscuring the application of unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present application in virtually any appropriately detailed structure.
The specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the application.
A first embodiment of the present invention provides a terminal power supply method, as shown in fig. 1, including the following steps:
step S101, a first control chip outputs a plurality of initial first register values and a plurality of initial second register values to a second control chip and detects whether a battery is accessed;
in this step, the first control chip outputs a plurality of initial first register values and a plurality of initial second register values to the second control chip, specifically: determining a plurality of initial first register values and a plurality of initial second register values according to a preset battery type; and outputting the initial first register values and the initial second register values to a second control chip. The preset battery type may be a battery type with a higher string number.
Step S102, when the first control chip detects that a battery is accessed, the first control chip determines a plurality of first register values according to the type of the battery and outputs the first register values to the second control chip so as to cover the initial first register values; enabling the second control chip to determine a plurality of second register values according to the type of the battery and cover the plurality of initial second register values; the second control chip respectively adjusts the power parameters of the battery and the power supply parameters of the terminal according to the first register values and the second register values so as to meet the power supply requirement of the terminal;
and when the first control chip detects that no battery is accessed, the second control chip adjusts the power supply parameters of the terminal according to the initial first register values and the initial second register values so as to meet the power supply requirement of the terminal.
The power parameters of the battery in this step may specifically include charging parameters and/or discharging parameters of the battery, and the power parameters of the battery and the power supply parameters of the terminal are adjusted to achieve that different types of batteries can meet the power supply requirements of the terminal, so as to supply power to the terminal by using the battery and/or an external power supply.
In the step, when no battery access is detected, the power supply parameters of the terminal are adjusted by utilizing the initial first register values and the initial second register values to meet the power supply requirement of the terminal, so that the power can be supplied to the terminal by utilizing an external power supply even under the condition of no battery access.
In this embodiment, the first control chip is a control chip EC; the second control chip is a charging IC. The terminal in this embodiment includes, but is not limited to, a notebook computer and a tablet computer.
When a battery is accessed, the power parameters of the battery and the power supply parameters of the terminal are adjusted according to different battery types, so that the power supply requirement of the terminal can be met even under the condition that the battery is inserted in a mixed manner; when no battery is connected, the power supply parameters of the terminal are adjusted according to the preset values, so that the power supply requirement of the terminal is met, and the power supply requirement of the terminal can be met under different conditions.
A second embodiment of the present invention provides a terminal power supply method, and this embodiment further introduces the technical solution of the present invention in more detail on the basis of the first embodiment. As shown in fig. 2, the terminal power supply method of this embodiment may specifically include the following steps:
step S201, a control chip EC outputs a plurality of initial first register values and a plurality of initial second register values to a charging IC, and detects whether a battery is accessed; if it is detected that a battery is accessed, executing step S202; if no battery access is detected, go to step S206;
step S202, a communication relation is established between a control chip EC and the battery according to a first communication protocol; the control chip EC identifies the type of the battery to determine the string number of the battery; the control chip EC determines a plurality of first register values according to the string number of the battery; the control chip EC outputs the first register values to the charging IC to cover the initial first register values;
in this step, after the control chip EC and the battery establish a communication relationship according to the first communication protocol, when the control chip EC cannot communicate with the battery, the method further includes: charging the battery with a predetermined current. Wherein the predetermined current is 256mA in magnitude.
Step S203, the control chip EC outputs a battery access signal to the charging IC;
and step S204, the charging IC chip identifies the type of the battery to determine the string number of the battery, and the charging IC determines a plurality of second register values according to the string number of the battery.
Step S205, the charging IC adjusts the power parameter of the battery and the power supply parameter of the terminal according to the first register values and the second register values respectively so as to meet the power supply requirement of the terminal;
and step S206, the charging IC adjusts the power supply parameters of the terminal according to the initial first register values and the initial second register values so as to meet the power supply requirement of the terminal.
In the embodiment of the invention, after the control chip EC is electrified, an initial first register value and an initial second register value are provided according to the type of the high-string-number battery and are output to the charging IC. The control chip EC is electrically connected to a battery control chip in the battery, as shown in fig. 3, which shows a schematic structural diagram of the battery control chip, and the control chip EC determines whether the battery is connected by detecting the level of the TEMP PIN potential of the battery control chip. For example, when the TEMP PIN PIN of the battery control chip is detected to be at a low potential, the battery is accessed, and the control chip EC establishes communication with the battery control chip through a communication protocol SMbus; the control chip EC identifies the type of battery to determine the values of a series of registers and writes these register values to the charging IC. In addition, in this embodiment, one pin of the Control chip EC is further electrically connected to one pin of the charging IC through a switch (PQ4806), as shown in fig. 4, a schematic diagram showing a connection relationship between one pin of the Control chip EC and the switch (PQ4806) is shown, when the Control chip EC writes the determined register value corresponding to the battery type into the charging IC, the Control chip EC pulls down the Series Control pin to output a low level signal to the switch to turn on the switch, so that the charging IC knows that the battery is connected, and starts to identify the battery type by using the pin of the charging IC, and determines a corresponding register value according to the battery type and writes the register value into the charging IC.
Preferably, in this embodiment, after the charging IC adjusts the power parameter of the battery and the power supply parameter of the terminal, or after the charging IC adjusts the power supply parameter of the terminal, the method in this embodiment further includes: and the control chip EC detects whether the power adapter is switched in or out, and if the power adapter is detected to be switched in or out, the register value in the charging IC is kept unchanged. That is, in the case where there is a connection or disconnection of the power adapter to the terminal, the register value in the charging IC remains unchanged.
Preferably, in this embodiment, after the charging IC adjusts the power parameter of the battery and the power supply parameter of the terminal, the method in this embodiment further includes detecting whether the battery is unplugged by the control chip EC, and if the battery is unplugged, the control chip EC outputs a plurality of initial first register values and a plurality of initial second register values to the charging IC to cover the plurality of first register values and the plurality of second register values in the charging IC.
That is, when a battery is accessed, the control chip EC and the charging IC determine a plurality of first register values and a plurality of second register values corresponding to the battery type according to the battery type, and after the determined register values corresponding to the battery type are stored in the charging IC, the battery is pulled out, and then the control chip EC outputs a plurality of initial first register values and a plurality of initial second register values to the charging IC again. Therefore, under the condition that no battery is accessed, the charging IC can still meet the power supply requirement of the terminal after adjusting the power supply parameters of the terminal according to the initial first register values and the initial second register values.
A third embodiment of the present invention provides a terminal power supply apparatus, as shown in fig. 5, including: the system comprises a first control chip 1 and a second control chip 2, wherein the first control chip 1 is in communication connection with the second control chip 2;
the first control chip is used for outputting a plurality of initial first register values and a plurality of initial second register values to the second control chip and detecting whether a battery is accessed. The initial first register values and the initial second register values are determined according to a preset battery type. The preset battery type may be a battery type with a higher string number.
When the first control chip detects that a battery is accessed, the first control chip is used for determining a plurality of first register values according to the type of the battery and outputting the first register values to the second control chip so as to cover the initial first register values; enabling the second control chip to determine a plurality of second register values according to the type of the battery and cover the plurality of initial second register values; the second control chip is used for adjusting the power parameters of the battery and the power supply parameters of the terminal according to the first register values and the second register values so as to meet the power supply requirement of the terminal;
and when the first control chip detects that no battery is accessed, the second control chip is used for adjusting the power supply parameters of the terminal according to the plurality of initial first register values and the plurality of initial second register values so as to meet the power supply requirement of the terminal.
In this embodiment, the first control chip is a control chip EC; the second control chip is a charging IC.
Specifically, in this embodiment, when the first control chip detects that a battery is accessed, the first control chip is configured to determine a plurality of first register values according to a type of the battery, and specifically includes:
when the first control chip detects that the battery is accessed, the first control chip is used for establishing a communication relation with the battery according to a first communication protocol;
the first control chip is used for identifying the type of the battery so as to determine the string number of the battery;
the first control chip is used for determining a plurality of first register values according to the string number of the battery.
Specifically, in this embodiment, after the first control chip determines a plurality of first register values according to the type of the battery and outputs the plurality of first register values to the second control chip to cover the plurality of initial first register values, the first control chip is further configured to output a battery access signal to the second control chip, so that the second control chip identifies the type of the battery to determine the string number of the battery, and the second control chip determines a plurality of second register values according to the string number of the battery.
Preferably, in this embodiment, after the first control chip establishes the communication relationship with the battery according to the first communication protocol, when the first control chip cannot communicate with the battery, the first control chip is further configured to charge the battery by using a predetermined current.
Preferably, in this embodiment, after the second control chip adjusts the power parameter of the battery and the power supply parameter of the terminal, or after the second control chip adjusts the power supply parameter of the terminal, the first control chip is further configured to detect whether a power adapter is connected or disconnected, and if it is detected that the power adapter is connected or disconnected, the register value in the second control chip is kept unchanged. That is, in the case where there is a connection or disconnection of the power adapter to the terminal, the register value in the second control chip remains unchanged.
Preferably, in this embodiment, after the second control chip adjusts the power parameter of the battery and the power supply parameter of the terminal, the first control chip is further configured to detect whether the battery is pulled out, and if the battery is pulled out, the first control chip is configured to output a plurality of initial first register values and a plurality of initial second register values to the second control chip so as to cover the plurality of first register values and the plurality of second register values in the second control chip.
In the embodiment of the present invention, the first control chip is a control chip EC, and as shown in fig. 6, a work flow chart of the control chip EC includes the following steps:
step 1, controlling the power-on of a chip EC;
step 2, the control chip EC gives an initial first register value and an initial second register value according to the type of the high-string-number battery;
step 3, detecting whether the potential of the TEMP PIN PIN of the battery is high potential by the control chip EC; if the detection is not high potential, step 4 is executed, if the detection is high potential, step 5 is executed
And 4, the control chip EC outputs the initial first register value and the initial second register value to the charging IC.
Step 5, the control chip EC establishes communication with the battery through a communication protocol SMbus and judges whether the communication is normal or not; if the communication is judged to be abnormal, executing the step 6; if the communication is determined to be normal, step 7 is executed,
step 6, pre-charging the battery by using 256mA current;
step 7, the control chip EC determines a plurality of first register values according to the number of the battery strings and writes the first register values into a second control chip;
and 8, the control chip EC outputs a battery access signal to the charging IC so that the charging IC determines a plurality of second register values according to the number of the battery strings and writes the second register values into the charging IC.
Step 9, the control chip EC detects whether the battery is removed; if not, keeping the current setting to keep the register value in the second control chip unchanged; if yes, re-executing step 2.
According to the embodiment of the invention, the bill of materials of different terminals does not need to be distinguished according to different battery series; and the problem caused by mixed insertion of different series of batteries under the NVDC framework can be solved. Meanwhile, the time sequence of plugging and unplugging all power adapters or batteries can be realized, and the power supply of the terminal cannot be influenced. The design requirement that different configurations share one mainboard is met.
The above embodiments are only exemplary embodiments of the present invention, and are not intended to limit the present invention, and the scope of the present invention is defined by the claims. Various modifications and equivalents may be made by those skilled in the art within the spirit and scope of the present invention, and such modifications and equivalents should also be considered as falling within the scope of the present invention.