A kind of battery charge controller and charge control method
Technical field
The present invention relates to moving communicating field, in particular a kind of battery charge controller and charge control method.
Background technology
At present, mobile terminal is along with scientific and technological development is popularized greatly, and the use of mobile phone, flat board and computer is also more and more important in daily life.Increasing of mobile terminal function, adds the lifting of utilization rate, causes user also higher to the quality requirement as the battery of main power source in mobile terminal, the standby amount of overlength, and the electric weight of superelevation has been stored as the serious hope of people to battery.
But in actual life, due to technical restriction, the battery of high memory space can't meet the demands at present, people's necessary work in the time using mobile terminal to battery charging, along with world-class mobile terminal production firm of many families such as Samsung, the apple relevant accident of in succession charging, mobile terminal production firm and user also more and more pay attention to for charging safety, if mobile terminal meets accident in the time of charging, not only mobile terminal is damaged, likely can threaten to user's safety.
Because the research and development of mobile terminal are very complicated, after mobile terminal is sold in user's hand, there are unavoidably some still unsolved bug, or even can make in some cases mobile terminal crash; If now mobile terminal charges, and mobile terminal causes crashing for some reason, and charge function may will not be subject to mobile terminal control, and this is breakneck.
Therefore prior art awaits further improvement.
Summary of the invention
In view of above-mentioned weak point of the prior art, the object of the invention is to provides a kind of battery charge controller and a kind of charge control method for user, to solve in prior art owing to can not finding in time the fault that mobile terminal occurs in charging process, cause the problem of charging accident.
The technical scheme that technical solution problem of the present invention adopts is as follows:
A kind of battery charge controller, wherein, for the charging process of mobile terminal is controlled automatically, the battery that described device comprises connected successively charging input interface, charge switch, power management chip and timer and is connected with described power management chip;
Described charging input interface, charges to the battery of mobile terminal for connecting charger;
Described power management chip, for coupled battery is charged, and resets to described timer every the first Preset Time;
Described timer, for the charging interval of charging circuit is carried out to timing, when timer time exceeds the second Preset Time, exports high level pulse charge switch is disconnected, and stops battery charging;
Described the second Preset Time is greater than described the first Preset Time.
Described battery charge controller, wherein, described power management chip comprises: charger connection detection module, software timer, timer reseting module and timer enable module;
Described charger connection detection module, for whether charging input interface is connected and is detected with charger, triggers described software timer if connect and starts timing;
Described software timer, for carrying out timing to the charging interval;
Described timer reseting module, for when detecting that described software timer exceeds after the first Preset Time, resets to described timer;
Described timer enable module, opens timing or stops timing for controlling described timer.
Described battery charge controller, wherein, described timer comprises Enable Pin, reset terminal and output, and described Enable Pin is connected with described timer enable module, described reset terminal is connected with described timer reseting module, and described output is connected with charge switch;
Described timer enable module by output high level pulse to timer enable bring in the timing of opening timing device, make timer stop timing by output low level pulse to timer;
Described timer reseting module, when detect software timer overtime after output high level pulse to the reset terminal of timer, make timer reclocking.
Described battery charge controller, wherein, described charger connection detection module, judges by the interruption that detects charging input interface generation whether charger is connected with charging input interface; In the time detecting that rising edge interrupts, charger is connected with mobile terminal, and in the time detecting that trailing edge interrupts, charger and charging input interface disconnect.
Described battery charge controller, wherein, described charger connection detection module is controlled software timer and is closed after detecting that charger and charging input interface disconnect, and timer enable module output low level pulse to timer Enable Pin makes timer stop timing simultaneously.
A kind of charge control method, wherein, utilizes the control of charging of described device, and described method comprises:
A, charging input interface, charge switch, power management chip and timer are connected successively;
B, use charging input interface are connected with charger;
C, power management chip charge to coupled battery, and every the first Preset Time, timer are resetted;
If D timer exceeds the second Preset Time, export high level pulse charge switch is disconnected, stop battery charging;
Described the second Preset Time is greater than described the first Preset Time.
Described charge control method, wherein, in above-mentioned steps, C comprises:
C1, whether charging input interface is connected and is detected with charger, trigger described software timer if connect and start timing;
C2, for when detecting that described software timer exceeds after the first Preset Time, resets to described timer;
Described charge control method, wherein, described timer comprises Enable Pin, reset terminal and output, and described Enable Pin is connected with described timer enable module, described reset terminal is connected with described timer reseting module, and described output is connected with charge switch;
Above-mentioned steps C also comprises:
Described timer enable module by output high level pulse to timer enable bring in the timing of opening timing device, make timer stop timing by output low level pulse to timer;
Export the reset terminal of high level pulse to timer when detecting after software timer exceeds the first Preset Time, make timer reclocking.
Described charge control method, wherein, also comprises in described step B whether connecting charger detects to charging input interface;
In the time detecting that rising edge interrupts, charger is connected with charging input interface, and in the time detecting that trailing edge interrupts, charger and charging input interface disconnect.
Described charge control method, wherein, after detecting that charger and charging input interface disconnect, controls software timer and closes, and timer enable module output low level pulse to timer Enable Pin makes timer stop timing simultaneously.
Beneficial effect, a kind of battery charge controller provided by the present invention and charge control method, by set up charge switch in charging circuit, power management chip and timer, by power management chip, the timing in timer is monitored, in the time that mobile terminal normally moves, every the first Preset Time, timer is resetted, if mobile terminal breaks down, timer timing does not also reset or stops timing after the second Preset Time, control timer output high level pulse disconnects charge switch, thereby cut-out charging circuit, avoid the generation of charging accident.
Brief description of the drawings
Fig. 1 is the structure principle chart of a kind of battery charge controller of the present invention.
Fig. 2 is the structure principle chart of power management chip and timer in the present invention.
Fig. 3 is the flow chart of steps of a kind of charge control method in the present invention.
Embodiment
For making object of the present invention, technical scheme and advantage clearer, clear and definite, developing simultaneously referring to accompanying drawing, the present invention is described in more detail for embodiment.Should be appreciated that specific embodiment described herein, only for explaining the present invention, is not intended to limit the present invention.
The invention discloses a kind of battery charge controller, as shown in Figure 1, described battery charge controller is used for the charging process of mobile terminal automatically to control, the battery 400 that described device comprises connected successively charging input interface 100, charge switch 200, power management chip 300 and timer 500 and is connected with described power management chip 300.
Described charging input interface 100, charges to the battery of mobile terminal for connecting charger.
Described power management chip 200, charges for the battery 400 to coupled, and every the first Preset Time, described timer 500 is resetted.
Described timer 500, for the charging interval of charging circuit is carried out to timing, exceeds the second Preset Time when 500 times of timer, exports high level pulse charge switch 200 is disconnected, and stops battery 400 to charge.
Described the second Preset Time is greater than described the first Preset Time.
When charging input interface access charger, charge switch closure, starts battery to charge, and power management chip resets to timer every the first Preset Time, output low level pulse of timer, and battery normally charges.If battery is in the time of charging, over-burden or while there is bug due to CPU for mobile terminal, power management chip cannot be according to default resetting to described timer every the first Preset Time, therefore in the time that the time in timer reaches the second Preset Time, timer is directly exported high level pulse and is made charge switch disconnection, thereby avoids the generation of charging accident.
Preferably, described the first Preset Time can be set to 800 seconds, and described the second Preset Time is set to 1000 seconds, and above-mentioned Preset Time can also can manually arrange by user by described device default setting.
Concrete, as shown in Figure 2, described power management chip 300 comprises with lower module: charger connection detection module 340, software timer 310, timer reseting module 320 and timer enable module 330.
Described charger connection detection module 340, for whether charging input interface is connected and is detected with charger, triggers described software timer 500 if connect and starts timing.
Described charger connection detection module, judges by the interruption that detects charging input interface generation whether charger is connected with charging input interface; In the time detecting that rising edge interrupts, charger is connected with mobile terminal, and in the time detecting that trailing edge interrupts, charger and charging input interface disconnect.
Described charger connection detection module is controlled software timer and is closed after detecting that charger and charging input interface disconnect, and timer enable module output low level pulse to timer Enable Pin makes timer stop timing simultaneously.
Described software timer 310, for carrying out timing to the charging interval.
Described timer reseting module 320, for when detecting that described software timer 310 exceeds after the first Preset Time, resets to described timer 500.
Described timer enable module 330, opens timing or stops timing for controlling described timer 500.
As can be seen from Figure 2, described timer comprises Enable Pin EN, reset terminal RST and output OUT, described Enable Pin EN is connected with described timer enable module 330, and described reset terminal RST is connected with described timer reseting module 320, and described output is connected with charge switch.
Described timer enable module is carried out the timing of opening timing device by output high level pulse to the Enable Pin EN of timer, makes timer stop timing by output low level pulse to timer.
Described timer reseting module, when detect software timer overtime after output high level pulse to the reset terminal of timer, make timer reclocking.
In the time that charger connection detection module detects that charging inlet is connected with charger, trigger software timer and carry out timing, when detecting that the timing of software timer exceeds after the first Preset Time, by the timer reseting module being connected with software timer, timer is resetted, concrete pass through exported the reset terminal of high level pulse to timer, makes timer reclocking.
If mobile terminal in charging process because system response is excessively slow, cause timer reseting module timer to be resetted in the default time, timer will be proceeded timing, after timing in timer exceeds the second Preset Time, timer output end OUT will export high level pulse, and charge switch is disconnected.
On the basis of described battery charge controller provided by the invention, as shown in Figure 3, the invention also discloses a kind of charge control method, wherein, utilize the control of charging of described device, described method comprises:
S1, charging input interface, charge switch, power management chip and timer are connected successively; Concrete connected mode as shown in Figure 1.
S2, use charging input interface are connected with charger.
S3, power management chip charge to coupled battery, and every the first Preset Time, timer are resetted;
If S4 timer exceeds the second Preset Time, export high level pulse charge switch is disconnected, stop battery charging;
Described the second Preset Time is greater than described the first Preset Time.
Described charge control method, wherein, in above-mentioned steps, S3 comprises:
S31, whether charging input interface is connected and is detected with charger, trigger described software timer if connect and start timing;
S32, for when detecting that described software timer exceeds after the first Preset Time, resets to described timer;
Described charge control method, wherein, described timer comprises Enable Pin, reset terminal and output, and described Enable Pin is connected with described timer enable module, described reset terminal is connected with described timer reseting module, and described output is connected with charge switch;
Above-mentioned steps S3 also comprises:
Described timer enable module by output high level pulse to timer enable bring in the timing of opening timing device, make timer stop timing by output low level pulse to timer;
Export the reset terminal of high level pulse to timer when detecting after software timer exceeds the first Preset Time, make timer reclocking.
In described step S2, also comprise whether connecting charger detects to charging input interface; In the time detecting that rising edge interrupts, charger is connected with charging input interface, and in the time detecting that trailing edge interrupts, charger and charging input interface disconnect.
After detecting that charger and charging input interface disconnect, control software timer and close, timer enable module output low level pulse to timer Enable Pin makes timer stop timing simultaneously.
A kind of battery charge controller provided by the present invention and charge control method, by set up charge switch in charging circuit, power management chip and timer, by power management chip, the timing in timer is monitored, in the time that mobile terminal normally moves, every the first Preset Time, timer is resetted, if mobile terminal breaks down, power management chip cannot normally reset to timer, timer will be proceeded timing, if timer timing does not also reset or stops timing after the second Preset Time, control timer output high level pulse disconnects charge switch, thereby cut-out charging circuit, avoid the generation of charging accident.
Be understandable that, for those of ordinary skills, can be equal to replacement or change according to technical scheme of the present invention and inventive concept thereof, and all these changes or replacement all should belong to the protection range of the appended claim of the present invention.