[summary of the invention]
Technical matters to be solved by this invention provides a kind of mobile terminal device and method for start-up and shutdown thereof, in the time of can losing efficacy at the switch switch of equipment, does not need the machine of tearing open just to turn off equipment, recovers normal switch machine function.
The technical scheme that technical solution problem of the present invention is adopted provides a kind of mobile terminal device, this mobile terminal device comprises multiplexing key, start key and time-delay shutdown circuit, wherein, during start as start key as described in pressing simultaneously and as described in multiplexing key, then this mobile terminal device is finished to enter after the initialization and is downloaded or debugging mode; As multiplexing key as described in not pressing, then this mobile terminal device is finished run user program after the initialization during start.
Described mobile terminal device, wherein, this time-delay shutdown circuit lost efficacy when multiplexing key is pressed.
Described mobile terminal device wherein, when user program is made mistakes, is pressed described multiplexing key, and this mobile terminal device is walked around user program and entered debugging, downloading mode.
Described mobile terminal device wherein, during deadlock, is pressed described start key, starts described time-delay shutdown circuit to close described mobile terminal device, wherein, presses the time constant of the duration of described start key greater than described time-delay shutdown circuit.Need length by the start key as normal boot-strap or in using, press then this time-delay shutdown circuit of maskable of multiplexing key.
Described mobile terminal device, wherein, this time-delay shutdown circuit comprises:
First resistance, an end of this first resistance connects first end of this start key, the second end ground connection of this start key;
First electric capacity, an end of this first electric capacity is connected with the other end of this first resistance, and the other end of this first electric capacity inserts power supply;
OR-NOT circuit comprises first input pin, second input pin and output pin, and first input pin of this OR-NOT circuit and this first resistance are connected with this first electric capacity, and node links to each other;
The MOSFET pipe, its grid links to each other with this output pin of this OR-NOT circuit;
Wherein, this first resistance and first electric capacity determine the time constant of this time-delay shutdown circuit.
Described mobile terminal device, wherein, this mobile terminal device also comprises:
Power management chip, the drain electrode of this MOSFET pipe is connected with the signal input pin of keeping of this power management chip;
Baseband chip, the source electrode of this MOSFET pipe is connected with the signal output pin of keeping of this baseband chip; First end of this multiplexing key is connected with the multiplexing key detection port of this baseband chip, the second end ground connection of described multiplexing key;
Phase inverter, the multiplexing key detection port of this baseband chip of input end of this phase inverter connects, and the output terminal of this phase inverter is connected with second input pin of this OR-NOT circuit.
Described mobile terminal device, wherein, this mobile terminal device also comprises:
Second resistance, an end connects power supply, and the other end is connected to the connected node of first resistance and start key;
Second electric capacity, an end ground connection, the other end links to each other with the node of second resistance with first resistance;
The 3rd resistance, an end ground connection, the node that the output terminal of the other end and this phase inverter and second input pin of this OR-NOT circuit are connected connects.
A kind of method for start-up and shutdown of mobile terminal device, wherein,
As pressing start key and multiplexing key simultaneously, then this mobile terminal device enters download or debugging mode after finishing initialization during start;
As multiplexing key as described in not pressing, then this mobile terminal device is finished run user program after the initialization during start.
The method for start-up and shutdown of described mobile terminal device wherein, when start enters download or debugging mode, is pressed this multiplexing key, and the maskable time-delay shutdown circuit is not so that shut down by the start key in download or debugging duration; When user program is made mistakes, press this multiplexing key, this mobile terminal device is walked around user program and is entered debugging, downloading mode.
The method for start-up and shutdown of described mobile terminal device wherein, during deadlock, is pressed this start key, starts a time-delay shutdown circuit to close this mobile terminal device, wherein, presses the time constant of the duration of this start key greater than this time-delay shutdown circuit.
By above embodiment, the present invention makes mobile device the time can judge automatically that in start entering normal boot-strap still enters and download or debugging mode; When user program is made mistakes,, can get around user program and download again or debug by multiplexing key; Simultaneously when the switch switch of equipment lost efficacy, can force turn off equipment, need not tear shell open, pull out battery and just can shut down by time-delay shutdown circuit of the present invention, thereby allow system restart, thus simple to operate, switching on and shutting down easily, it is convenient to transplant, and is applicable to various mobile-terminal platforms.
[embodiment]
The present invention is described in detail below in conjunction with drawings and Examples.
Fig. 1 is the process flow diagram of the mobile terminal device method for start-up and shutdown that provides of the embodiment of the invention.See also shown in Figure 1ly, the present invention includes following steps:
Step S1: mobile terminal device is started shooting.
Particularly, in this step, press the start key of mobile terminal device by the user and start shooting.
Step S2: carry out initialization.
Particularly, in this step, the system of mobile terminal device is carried out initialization by initialize routine.
Step S3: judge whether the user presses multiplexing key.If judging the user has pressed multiplexing key, then enter step S4.If judging the user does not press multiplexing key, then enter step step S5.
Therefore generally speaking, mobile terminal device enters initialization procedure from starting shooting to all very quick, is preferably will start shooting key and multiplexing key of user and presses easier triggering step S4 simultaneously.
Step S4: mobile terminal device enters download or debugging mode after finishing initialization.
In this step, when start enters download or debugging mode, press this multiplexing key, the maskable time-delay shutdown circuit.After the time-delay shutdown circuit conductively-closed, length can not make the mobile phone forced shutdown by the start key yet.
Step S5: mobile terminal device is finished run user program after the initialization.
Step S6: judge whether user program makes mistakes.If user program is made mistakes, then enter step S7.If user program is not made mistakes, then return step S5, continue the run user program.
Step S7: judge whether the user presses multiplexing key.If the user presses multiplexing key, then mobile terminal device is walked around user program and is entered download or debugging mode.
This method further comprises the forced shutdown flow process when mobile terminal device crashes.When mobile terminal device crashes, press this start key, start a time-delay shutdown circuit to close this mobile terminal device.In the present embodiment, press the time constant of the duration of start key greater than time-delay shutdown circuit.
Above-mentioned method for start-up and shutdown of the present invention makes mobile device the time can judge automatically that in start entering normal boot-strap still enters and download or debugging mode; When user program is made mistakes,, can get around user program and download again or debug by multiplexing key; When the switch switch of equipment lost efficacy, can turn off equipment simultaneously, not need to tear open machine and just turn off equipment, recover normal switch machine function by constrained delay shutdown circuit of the present invention.Constrained delay shutdown circuit of the present invention conductively-closed as required simultaneously, shutdown circuit does not influence normal power on/off function yet.And the time of shutdown time-delay can be regulated with different demands according to platform specific, only needs to change the delay circuit parameter and gets final product.
The present invention also provides a kind of mobile terminal device, and multiplexing key and start key are arranged on this mobile terminal device, when start, presses multiplexing key, and this control device control main system enters download/debugging mode; When user program is made mistakes, press the start key, time-delay shutdown circuit starts turning-off mobile terminal equipment.
As shown in Figure 2, Fig. 2 is the circuit diagram that the embodiment of the invention provides mobile terminal device.Comprise in the mobile terminal device 10 of the present invention: control chip and time-delay shutdown circuit.Control chip comprises power management chip PMU 13 and baseband chip BB 14.Time-delay shutdown circuit links to each other with control chip, controlled chip controls.
This time-delay shutdown circuit comprises first resistance R 1, first capacitor C 1, OR-NOT circuit 11 and MOSFET pipe Q1.
One end of first resistance R 1 connects first end of this start key K1, the second end ground connection of this start key K1.
One end of first capacitor C 1 is connected with the other end of this first resistance R 1, and the other end of this first capacitor C 1 inserts power supply.
This first resistance and first electric capacity determine the time constant of this time-delay shutdown circuit, and when pressing the start key above after this time constant, first resistance and the first electric capacity serially connected nodes place (being rejection gate first input pin 111 places) voltage is by high step-down;
OR-NOT circuit 11 comprises first input pin 111, second input pin 113 and output pin 115, and first input pin 111 of this OR-NOT circuit links to each other with the series connection node of this first capacitor C 1 with this first resistance R 1.
MOSFET manages Q1, and its grid links to each other with this output pin 115 of this OR-NOT circuit 11.In the present embodiment, the delay time constant of time-delay shutdown circuit is 4.7 seconds, promptly presses the start key after 4.7 seconds, and first input pin 111 of OR-NOT circuit 11 is by high step-down.When OR-NOT circuit 11 all is low when first input pin 111 of OR-NOT circuit 11 and second input pin 113, output pin 115 output high level; When first input pin 111 of OR-NOT circuit 11 and second input pin 113 have any one to be high level, output pin 115 output low levels.OR-NOT circuit 11 output high level just can turn-off MOSFET pipe Q1, cut off HOLD signal at stop system.OR-NOT circuit 11 changes according to the signal of first input pin 111 and second input pin 113, the switch of control MOSFET pipe Q1, and decision HOLD signal is to connect or cut off.
Power management chip PMU 13, the drain electrode of this MOSFET pipe Q1 is connected with the signal input pin 133 of keeping of this power management chip 13.
Baseband chip 14, the source electrode of this MOSFET pipe Q1 is connected with the signal output pin 141 of keeping of this baseband chip; First end of this multiplexing key K2 is connected with the multiplexing key detection port of this baseband chip 14, the second end ground connection of described multiplexing key.
The multiplexing key detection port of input end 121 these baseband chips of phase inverter 12 connects, and the output terminal 123 of this phase inverter is connected with second input pin of this OR-NOT circuit.
Second resistance R, 2, one ends connect power supply, and the other end connects first resistance R 1.
Second capacitor C, 2, one end ground connection, the other end links to each other with the node of first resistance R 1 with second resistance R 2.
The 3rd resistance R 3, one end ground connection, the node that the output terminal 123 of the other end and this phase inverter 12 and second input pin 113 of this OR-NOT circuit 11 are connected connects.
Among Fig. 2 to keep first signal (being the BB_HOLD_OUT signal) that signal output pin 141 received be to press after the start key K1, feed back to the signal of power management chip PMU 13 after the baseband chip BB 14 initialization success, when keep signal input pin 133 by secondary signal (being the PMU_HOLD_IN signal) when being drawn high, expression baseband chip BB 14 initialization success.If baseband chip BB 14 does not finish initialization, just can not export HOLD signal (BB_HOLD_OUT signal and PMU_HOLD_IN signal).After starting, power management core PMU 13,, can close automatically if do not receive the HOLD signal through the regular hour; In the mobile terminal device operational process, if the HOLD signal is cut off, power management chip PMU 13 also can close automatically.The power supply of total system is also just turned off, system closedown.
Time-delay shutdown circuit lost efficacy when multiplexing key K2 presses, be that multiplexing key K2 triggers function of shielding, shielding constrained delay shutdown circuit: when multiplexing key K2 presses, phase inverter 12 is output as height, how long the key of no matter starting shooting this moment presses the time, OR-NOT circuit 11 output all can keep low, thereby MOSFET pipe Q1 keeps on-state, and the HOLD signal key of not started shooting is pressed the influence of time; When multiplexing key K2 unclamped, phase inverter 12 was output as low, and after the start key was pressed the overtime constant, OR-NOT circuit 11 outputs were high, and MOSFET pipe Q1 is turned off, and the HOLD signal is cut off, thus shutdown.The time constant optimum value is 4.7 seconds in the present embodiment, can adjust in different situations.
When the user starts shooting, press multiplexing key K2 key simultaneously, can allow system enter the download debugging mode, download or debug according to the control decision of PC end software, thereby get around user program.When entering debug function, some debugging software is pinned the start key for a long time because of starting slow needs, and this moment is as long as multiplexing key K2 keeps pressing, and the shutdown delay circuit will conductively-closed and inoperative, can shutdown system.If system makes mistakes during the download and upgrade program, as long as unclamp multiplexing key K2, pin start key more than 4.7 seconds, just can shutdown system, download again then; Multiplexing key K2 can be used as normal button and uses the multiplexing function effect when not being subjected to switching on and shutting down in user program; The present invention transplants conveniently, is applicable to various mobile-terminal platforms.
The mobile phone user program that occurs starting shooting is normally made mistakes and can not normally be moved.When hardware did not go wrong, initialize routine generally can not made mistakes and be caused initialize routine not moved.Therefore the present invention only need add code of the present invention in the initialize routine ending, does not need original initialize routine and master routine are done other changes, just can realize getting around when user program is made mistakes user program and enter the download debugging mode and download again or debug.The present invention simultaneously is very succinct, can be transplanted to different development platforms easily.
In the above-described embodiments, only the present invention has been carried out exemplary description, but those skilled in the art can carry out various modifications to the present invention after reading present patent application under the situation that does not break away from the spirit and scope of the present invention.