Under the dual-core mobile phone off-mode, charging and charging cause starting processing method and deviceTechnical field
The present invention relates to processing method and circuit structure that a kind of double-core windows mobile phone charges and causes thus starting shooting under off-mode.
Background technology
For the convenience of the user, a lot of mobile phones also allow by the USB line that connects computer, mobile phone to be charged when being equipped with charger, and the maximum charging current that charger and USB line allow is often different.When mobile phone charges under off-mode, need to start CPU, to current be to use the charging of charger or USB interface supply lines to judge, with the charging current that determines to use, both required to guarantee charging rate, also require the safety of assurance equipment, also need simultaneously to show friendly information, charging animation to the user, simple and convenient method of operation is provided.
Summary of the invention
The purpose of this invention is to provide a kind of double-core windows mobile phone charger or rear charging animation, information of showing rapidly of USB line insertion under off-mode of realizing, allow the user carry out easily some simple operationss and can determine charging current with the processing method of compatible GB and non-GB charger by software, and corresponding charging device.
Technical scheme of the present invention is as follows:
Cause the processing unit of starting shooting according to charging under a kind of dual-core mobile phone off-mode of the present invention and charging, comprise primary processor, it is responsible for operation system and application program;
Baseband chip, it is responsible for moving communication protocol stack; And battery, it is responsible for system power supply, is characterised in that:
A, at baseband chip one end, establish Power Management Unit, make primary processor, baseband chip, Power Management Unit and battery become two-way circuit to connect with serial bus successively, be responsible for powering on to primary processor by baseband chip during start;
B, at baseband chip one end, if charge controlling chip, and establish USB interface in primary processor one side, make primary processor, baseband chip, charge controlling chip and battery become two-way circuit to connect with serial bus successively, and currently by the primary processor judgement be charger or charged by the computer terminal that connects with usb bus;
The charging supply line of C, charger for mobile phone or the USB line that is connected with computer connects battery through charge controlling chip respectively, is to be determined the size of charging current by charge controlling chip after charger or USB by primary processor judgement charging source again;
Pass through the UART transmission information between D, primary processor and baseband chip, the primary processor end with the ring in UART as wake source, as wake source, the dsr with primary processor represents oneself state to baseband chip simultaneously with the dtr in primary processor, forms and guarantees two-way reliable communication structure.
Particularly, described charger for mobile phone comprises GB charger and non-GB charger.
Belong to same total technical conceive, cause the processing method of starting shooting according to charging under a kind of dual-core mobile phone off-mode of the present invention and charging, comprise step:
S1, charger or computer are inserted USB interface, and cause Power Management Unit to start and judge that the voltage of battery arrives threshold value? if reach threshold value, start baseband chip and enter the charging control flow,
S2, baseband chip judges whether the voltage of battery reaches the threshold value that starts primary processor, if start primary processor just reach threshold value, otherwise, with low current charge until voltage reaches the threshold value that starts primary processor,
S3, primary processor first moves bootloader after starting, and send expansion AT command to baseband chip, inquiry start reason, if the information that baseband chip returns is " charging causes start ", just enter the charging process flow process of primary processor end, otherwise, load Windows in internal memory, and the entry address of PC being revised as windows
S4, primary processor enumerates mode by USB and judges and currently provide charging to determine charging current to battery with charger or the computer that inserts USB interface,
S5, after determining the size of charging current, primary processor carries out initialization LCD and lcd controller work, carries out screen display work, then sign on screen in display reminding information on screen and the first width pattern of charging animation, afterwards, the primary processor end begins to carry out one section cyclic program
S6, in each circulation, whether program checkout receives that customer requirements start shooting and press particular key, if the start event detected, jumps out circulation, send expansion AT command to baseband chip, or in inspection FIFO, whether data arranged,
S7If, detect in serial ports FIFO and have data, it is read in the buffer that opens up in RAM, whether the data that reexamine in buffer comprise complete AT instruction, if comprise the AT instruction, press the content of AT order and carry out handling procedure, otherwise, data just kept, the data splicing that is used for and collects next time
S8, by above-mentioned steps after the AT handling procedure is carried out or data collect complete after, according to current whether arrival upgrade motion picture time and battery and whether be full of electricity screen pattern is processed,
S9, detect whether unattended for a long time, if primary processor notice baseband chip, then close screen, and the wake source of user's wake source ring and baseband chip is set, and enters low power consumpting state, otherwise, return to S6, again begin circulation,
S10, if primary processor is waken up, and detects wake source, if the user wakes up, display frame forwards S to6, begin circulation, if baseband chip wakes up, at first confirm to wake reason up, if battery is full, open screen, display reminding information and picture if need not point out the user, are closed screen.
Advantage of the present invention is not only easy to operate but also guarantee security of operation, practical.
Description of drawings
Fig. 1 is the block diagram of hardware unit of the present invention.
Fig. 2 is the embodiments of the invention flow chart.
Embodiment
Provide a preferred embodiment of the present invention below in conjunction with Fig. 1 and Fig. 2, to describe technical scheme of the present invention in detail.
In this example, there is a primary processor (AP) 1 to be responsible for operation system and application program on mobile phone, separately has a baseband chip 2 to be responsible for the operation communication protocol stack.Keep being connected with the mobile network connection for the ease of processing when the device standby, Power Management Unit (PMU) 3 is connected to the baseband chip end, key is also detected by baseband chip 2 ends, powers on to primary processor 1 by baseband chip 2 is responsible during start.Therefore, under off-mode, after insertingcharger 6 or connectinghost side computer 7 by the USB line, at first baseband chip 2 powers on, and starts primary processor 1 by baseband chip 2.Because main USB correlation function is realized at primary processor 1 end, so USB interface judges that by primary processor 1 is responsible current is charger 6 chargings orcomputer 7 chargings of inserting USB interface at primary processor 1 end.After primary processor 1 started, what judge current insertion by software approach wascharger 6 or USB line connectionhost side computer 7, and such method can the old non-GB charger of Compatibility.Come transmission information by global functional serial port (Full Function UART) between primary processor 1 and baseband chip 2, primary processor 1 end is made as wake source to the ring in global functional serial port, baseband chip 2 ends are made as wake source to the dtr of primary processor 1, dsr with primary processor 1 represents oneself state simultaneously, to guarantee both sides' reliable communications.Adopt simultaneously gradation to collect the smoothness that mode that data splice guarantees animation, avoid data to send being interrupted by other interrupt mode causing flow process to be absorbed in waiting for causing animation to stagnate.
Be generalized into ten steps as described below according to embodiment of the present invention flow chart, be described as follows:
In the 1st step,charger 6 or the USB line that has connectedmain frame 7 insert interface, cause obtaining 5V voltage on the USB interface supply lines, andPower Management Unit 4 can judge whethercurrent battery 5 voltages reach the startup threshold value, if reach, start baseband chip 2, enter this flow process.
The 2nd step, baseband chip 2 readsbattery 5 voltages (with reference to figure 1) byPower Management Unit 3, if voltage reaches the threshold value that starts primary processor 1 starts primary processor 1, otherwise owing to not knowing that upper current limit can only be first with low current charge, until voltage reaches the threshold value that starts primary processor 1.
The 3rd step can directly not enter windows operating system after primary processor 1 starts but at first moves bootloader, and this part is used internal memory in the mode of flat board, carries out in the single task mode.Primary processor 1 can send expansion AT command to baseband chip 2 by serial ports here, and inquiry start reason is if the information that baseband chip 2 ends return represents it is because charging causes start, the charging process flow process that enters primary processor 1 end.Otherwise, load windows in internal memory, then the instruction pointer register of primary processor 1 is revised as the windows entry address.
The 4th step, primary processor 1 is enumerated mode by USB and is judgedcurrent charger 6 or themain frame 7 of USB line connection of using, if can not receive that usb reset interrupts, thinkingcharger 6, charging current is decided to be the electric current that charger allows, is 700mA in this example, if USB line, the size of charging current need to be applied for tomain frame 7 ends, is 500mA in this example, the maximum that this allows for usb protocol., preserve to guaranteemain frame 7 end equipment with low current charge if the application electric current is failed.After having determined charging current, need to send related expanding AT order to baseband chip 2 ends by serial ports, baseband chip is controlled charging chip 4 (with reference to figure 1) and is charged with respective electrical stream.
In the 5th step, after determining charging current, primary processor 1 need to carry out the work such as initialization display and display controller, carries out the work of screen display, then signs on screen in display reminding information on screen and the first width pattern of charging animation.Owing to can not use the file system of windows herein, so picture concerned, character string all can not be stored with document form, can only take to be kept on certain fixed address of nonvolatile memory or preserve in the mode of the constant in program.
Then primary processor 1 end begins to carry out one section cyclic program.Because this section program is carried out outside windows operating system fully, can regard as one independently, system that practical function is very single.
In the 6th step, in each circulation, whether program checkout receives the event of customer requirements start, in this example for pressing particular key.If detect, jump out circulation, send expansion AT command to baseband chip 2, require to open the modules such as radio frequency, in order to realize the functions such as normal conversation, note, then load windows.Otherwise check in serial ports FIFO whether data are arranged.
The 7th step, there are data in serial ports FIFO read data in the buffering area of opening up in internal memory if detect, then check whether the data in buffering area comprise complete AT order, if comprise carry out corresponding processing program according to the content of AT order, if do not comprise keep data, be used for and the data splicing of collecting next time.
In the 8th step, data are collected and completed after (if obtain AT order carry out rear at the AT handling procedure), whether expired screen pattern has been processed according to current renewal motion picture time and thebattery 5 of whether having arrived.
The 9th step, whether unattendedly for a long time detect, if it is then primary processor 1 notice baseband chip 2 closes screen, and the wake source that user's wake source and baseband chip 2 wake primary processor 1 up is set, and enters low power consumpting state, with the quickening charging rate.Otherwise returned to for the 6th step, again begin circulation.
The 10th the step, if primary processor 1 is waken up, detect wake source, if the user wakes up, display frame, forward to the 6th step begin the circulation.If baseband chip 2 wakes up, at first confirm to wake reason up, if the full screen of opening ofbattery 5, display reminding information and picture, if do not need to point out user's the information curtain of not spreading its tail, reentering low power consumpting state after processing, make this event to user transparent.