Summary of the invention
The technical problem to be solved in the present invention is, at the existing defective that can not realize the Memorability start automatically, provides a kind of starting terminal with memory method, circuit and terminal.
The technical solution adopted for the present invention to solve the technical problems is:
A kind of starting terminal with memory circuit, comprise: power supply and the master controller that is connected described power supply, it also comprises: monitoring unit is used for when described starting up of terminal state, obtain first state of the GPIO interface of master controller, send the signal of described first state to signal storage unit;
Signal storage unit is used for described first state is arranged to the first corresponding ident value; When described terminal powers on, send described first ident value to described monitoring unit, so that described monitoring unit carries out the Memorability start according to described first ident value.
Wherein, preferred, described monitoring unit also is used for, and when described terminal normal shutdown, obtains second state of the GPIO interface of master controller, sends the signal of described second state to described signal storage unit;
Described signal storage unit is arranged to the second corresponding ident value with described second state, when described terminal powers on, sends described second ident value to described monitoring unit, so that described monitoring unit is according to the processing of then not starting shooting of described second ident value.
Wherein, preferred, described monitoring unit is a microcontroller, and described microcontroller is connected with described master controller, and described signal storage unit is a storer, and described storer is connected with described microcontroller.
Wherein, preferably, described monitoring unit is programmable logic device (PLD) (CPLD or FPGA), and described programmable logic device (PLD) is connected with described master controller, described signal storage unit is a pulsed triggering circuit, and described pulsed triggering circuit is connected with described programmable logic device (PLD).
A kind of starting terminal with memory method comprises the described boot-strap circuit of technique scheme, and described method comprises step:
When terminal was in open state, master controller was changed to first state with the level of GPIO interface;
Microcontroller is first ident value according to the data of the first state designated memory address of described GPIO interface;
When described terminal powered on, described microcontroller obtained described storage address data, if described data are first ident value, determined that shutdown last time of described terminal is illegal shutdown, and described microcontroller carries out the Memorability start.
Wherein, preferred, further comprise:
When the terminal normal shutdown, primary controller is changed to second state with the level of described GPIO interface, and notifies described microcontroller that described storage address data are become second ident value;
When described terminal powered on, described microcontroller obtained described storage address data, if described data are second ident value, determined that then shutdown last time is normal shutdown, does not then carry out the Memorability start.
A kind of starting terminal with memory method comprises the described boot-strap circuit of technique scheme, it is characterized in that described method comprises step:
When described terminal was illegally shut down, described pulsed triggering circuit specified register to be changed to first ident value it;
When described pulsed triggering circuit was powered again, described pulsed triggering circuit knew that the value of described appointment register is first ident value, produces a pulse signal;
Described programmable logic device (PLD) receives described pulse signal, triggers Memorability start flow process.
Wherein, preferred, described pulsed triggering circuit specifies register to be changed to first ident value it, afterwards, further comprises step: when described terminal normal shutdown, described pulsed triggering circuit specifies register to be changed to second ident value it;
When described pulsed triggering circuit was powered again, described pulsed triggering circuit knew that the value of described appointment register is second ident value, does not produce pulse signal, did not trigger the programmable logic device (PLD) flow process of starting shooting.
The present invention also provides a kind of terminal, and it comprises the described Memorability boot-strap circuit of technique scheme.
Implement technical scheme of the present invention, have following beneficial effect: by terminal cut off the power supply last time information that moment preserves realize behind the power interruption recovering automatically, the Memorability start.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
The embodiment of the invention provides a kind of starting terminal with memory circuit, as shown in Figure 1, comprise: power supply 10 and the master controller 20 that is connected described power supply 10, monitoring unit 30, be used for when described starting up of terminal state, obtain first state of the GPIO interface of master controller 20, send the signal of described first state to signal storage unit 40;
Signal storage unit 40 is used for described first state is arranged to the first corresponding ident value; When described terminal powers on, send described first ident value to described monitoring unit 30, so that described monitoring unit 30 carries out the Memorability start residing state of system of the terminal of cut off the power supply last time (that is: return to) according to described first ident value moment.
In addition, in a further embodiment, described monitoring unit 30 also is used for, and when described terminal normal shutdown, obtains second state of the GPIO interface of master controller 20, sends the signal of described second state to described signal storage unit 40;
Described signal storage unit 40, described second state is arranged to the second corresponding ident value, when described terminal powers on, send described second ident value to described monitoring unit 30, [so that described monitoring unit 30 carries out the start of non-memory property according to described second ident value.] promptly: described monitoring unit 30 is according to the processing of then not starting shooting of described second ident value.
The more detailed embodiment of the foregoing description is described below in conjunction with accompanying drawing:
Embodiment one: as shown in Figure 2, this circuit comprises: power supply 140 and the master controller 110 that is connected described power supply 140, and also comprise microcontroller 120 and storer 130, described microcontroller 120 is connected with described master controller 110, described storer 130 is connected with described microcontroller 120, and described power supply 140 provides power supply for described master controller 110.In the present embodiment, described microcontroller is connected with the GPIO interface of described master controller.Described microcontroller 120 is used for described power supply 140 is carried out electrifying timing sequence control, and promptly the electrifying timing sequence requirement control power supply 140 by master controller 110 powers in the starting up of terminal process.
Accordingly, the embodiment of the invention also provides a kind of starting terminal with memory method, comprises the boot-strap circuit that the foregoing description provides, and as shown in Figure 3, described method comprises step:
111, when terminal is in open state, master controller is changed to first state with the level of GPIO interface; Concrete:
When the terminal processes open state, the terminal master controller is changed to high level (also can be changed to low level) with the GPIO interface of appointment.
112, microcontroller is first ident value according to the data of the first state designated memory address of described GPIO interface; Concrete:
Microcontroller is changed to 1 (also can be changed to 0) according to first state (high level) of GPIO interface with designated memory address date (last time closed machine information and preserve the position).
113, when described terminal powers on, described microcontroller obtains described storage address data, if described data are first ident value, determines that then shutdown last time of described terminal is illegal shutdown, and described microcontroller carries out the Memorability start.
Concrete: when described terminal powered on, microcontroller at first started, and loaded the storage address data of above-mentioned appointment automatically, if be 1, then the last shutdown of explanation is illegal shutdown, and microcontroller will be carried out the start electrifying timing sequence, start shooting.
In the method, further comprise:
When the terminal normal shutdown, primary controller (is distinguished level second state that is changed to of described GPIO interface with described first state mutually, if described first state is a high level, this second state is a low level so, opposite, if first state is a low level, this second state is a high level so), and notify described microcontroller that described storage address data are become second ident value (if first ident value is 1, this second ident value is 0 so);
That is: when the terminal normal shutdown, in shutdown process, master controller will specify the GPIO interface to be changed to low level (also can be high level, level during with open state is distinguished mutually and is got final product), this master controller notice microcontroller is with the above-mentioned address date zero clearing of storer, and this moment, described second ident value was 0;
When described terminal powered on, described microcontroller obtained described storage address data, (was: 0), determine that then shutdown last time is normal shutdown, does not then carry out the Memorability start if described data are second ident value.Because when terminal is illegally shut down owing to factors such as accident power-offs, the normal shutdown process of master controller neither one, the clear operation that can't notify microcontroller to carry out the above-mentioned address date of storer, at this moment the storage address data still are 1.So can be 1 to confirm that be illegal shutdown last time according to these data.
The Application Example of the circuit, method and the terminal that provide in conjunction with the foregoing description is provided below, as shown in Figure 4:
121, civil power is to the terminal beginning that powers on,
122, microprocessor is carried out initialization action, mainly is initialize power management coherent signal;
123, microprocessor loads on the address of appointment and closes machine information and preserve the position, judges that described preservation bit data is 1 still is 0;
If 124 data of preserving the position are 1, then carry out the program that powers on of starting shooting, the guiding terminal start;
If 125 is 0, then circular wait start button is pressed or is started shooting by WOL (Wake On LAN);
126, after the execution start program of powering on was finished start, microprocessor detected the level of GPIO interface;
If it is high level that 127 microprocessors detect the GPIO interface, then the pass machine information of storer being preserved the position is 1;
If it is low level that 128 microprocessors detect the GPIO interface, then the pass machine information of storer being preserved the position is 0;
Because: terminal is a normal shutdown, and master controller is put GPIO low in shutdown process, and it is low that microprocessor detects GPIO, and then the pass machine information of storer being preserved the position is 0; If terminal is illegal shutdown, master controller can't be carried out the normal shutdown flow process, can't the pass machine information of storer be saved as 0 by microcontroller.
Therefore, when the terminal normal shutdown, the value of closing machine information preservation position will be 0, otherwise will be 1.When will connecting civil power as next time, this selects the foundation of start scheme.
Embodiment two: as shown in Figure 5, the circuit that this embodiment two provides comprises: master controller 210, CPLD (the Complex Programmable Logic Device of power supply 240, the described power supply 240 of connection, CPLD) 220 and pulsed triggering circuit 230, described CPLD220 is connected with described master controller 210, described pulsed triggering circuit 230 is connected with described CPLD220, and described power supply 240 provides power supply for described master controller 210.In other embodiment, this CPLD220 also can be FPGA (Field-Programmable Gate Array, field programmable gate array).
Accordingly, the embodiment of the invention also provides a kind of starting terminal with memory method, comprises the boot-strap circuit that the foregoing description provides, and as shown in Figure 6, described method comprises step:
211, when described terminal is illegally shut down, described pulsed triggering circuit 230 specifies register to be changed to the 3rd ident value (as 1, also can be 0) it;
212, when described pulsed triggering circuit 230 is powered again, described pulsed triggering circuit 230 knows that the value of described appointment register is the 3rd ident value, produces a pulse signal;
213, described CPLD220 receives described pulse signal, triggers described master controller 210 and carries out Memorability start flow process.
Further, described pulsed triggering circuit in the step 211 specifies register to be changed to the 3rd ident value it, afterwards, can also comprise: when described terminal normal shutdown, it (is 0 in the present embodiment that described pulsed triggering circuit 230 specifies register to be changed to the 4th ident value it, also can be 1, different with described the 3rd ident value, and corresponding getting final product);
When described pulsed triggering circuit 230 was powered again, described pulsed triggering circuit 230 knew that the value of described appointment register is the 4th ident value, does not produce pulse signal, did not trigger the CPLD220 flow process of starting shooting.
The detailed operation process of this this method of circuit application is described below in conjunction with the method for this embodiment two:
When terminal is normal shutdown, master controller 210 will send off signal to CPLD220, and CPLD220 will be by close a terminal power supply and the GPIO interface level is changed to low level of the sequential requirement of normal shutdown.At this moment cut off civil power, then for pulsed triggering circuit 230, the level of GPIO interface is prior to the power supply step-down.
When system was illegal shutdown, civil power directly cut off, and pulsed triggering circuit 230 power supplys are owing to the capacitor discharge reason, after the meeting in the level step-down of GPIO interface.
According to above-mentioned principle, pulsed triggering circuit 230 is changed to 1 (also can be 0) with the appointment register in the pulsed triggering circuit, and under the situation of normal shutdown, will specifies register to put 0 (also can be 1) under the situation of illegal shutdown; Pulsed triggering circuit 230 is by preserving the information of this register in the plate powered battery.After powering up again, be 1 if specify the value of register, pulsed triggering circuit 230 produces a pulse signal, after CPLD220 receives this pulse signal, the flow process of starting shooting; Otherwise, be 0 if specify the value of register, pulsed triggering circuit will can not produce pulse when re-powering, then can not trigger the CPLD220 start.
The embodiment of the invention one also provides a kind of terminal, be used to realize the method and the Application Example thereof of the foregoing description one, as shown in Figure 7, this terminal 600 comprises: power supply 140 and the master controller 110 that is connected described power supply 140, and also comprise microcontroller 120 and storer 130, described microcontroller 120 is connected with described master controller 110, and described storer 130 is connected with described microcontroller 120, and described power supply 140 provides power supply for described master controller 110.In the present embodiment, described microcontroller is connected with the GPIO interface of described master controller.Described microcontroller 120 is used for described power supply 140 is gone up electric control (promptly providing power supply at the described power supply 140 of illegal shutdown back control to master controller 110).
The embodiment of the invention two also provides another kind of terminal, be used to realize the method and the Application Example thereof of the foregoing description two, as shown in Figure 8, this terminal 700 comprises: power supply 240, the master controller 210 that connects described power supply 240, CPLD (Complex Programmable Logic Device, CPLD) 220 and pulsed triggering circuit 230, described CPLD220 is connected with described master controller 210, described pulsed triggering circuit 230 is connected with described CPLD220, described power supply 240 provides power supply for described master controller 210
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.