Background technology
Programming tool is a kind of hardware tools that is used for to objective chip programming firmware code, the programming seat of objective chip is set on programming tool, when objective chip being installed in after this programming seat goes up, just can utilize the programming tool firmware code programming of will programming to suffer in objective chip.
The method of utilizing programming tool that objective chip is programmed is divided into online programming (being online programming) and two kinds of methods of offline programming (being off-line programing) usually: the online programming method just is to use upper layer software (applications) at computer terminal control programming instrument, chip is programmed, this is the most frequently used method, and everybody is familiar; And the offline programming method is exactly not use a computer, the direct method of using programming tool that chip is programmed, the firmware code that will programme earlier downloads in the programming tool by computing machine the corresponding interface specifically, directly uses programming tool that chip is programmed then.
Programming tool with regard at present general offline programming mode, core devices comprises a microcontroller chip, be used for storing the firmware code of programming tool self, to control and to realize programming operation, also comprise a chip external memory (generally adopting EPROM or EEPROM), generally be programmed firmware code and can be downloaded and be kept on this chip external memory.So, there is certain risk in the present this programming tool of offline programming of can realizing on safety, promptly be easy to the programming firmware code of preserving in the chip external memory is read, even handle through algorithm for encryption when preserving, also be easy to be cracked, inadequately safety.
The utility model content
The utility model is intended to solve the potential safety hazard that existing programming tool exists, and provides the firmware code of a kind of firmware code that will programme and programming tool self to be kept at the dual-purpose programming tool of safer reliable online/offline in the same chip.
The dual-purpose programming tool of safe online/offline of the present utility model, comprise: (1) is provided with the microcontroller chip that self firmware code is preserved the unit, wherein preserve in order to control and objective chip is carried out the communication interface that programming tool self firmware code (2) of programming operation links to each other with described microcontroller chip with realizing, in order to described programming tool is connected to the state indicating module that computing machine (3) links to each other with described microcontroller chip, indicate the duty (4) and described microcontroller chip of current programming tool and power supply thereof, the electric power loop that communication interface is connected with the programming seat, for the offline programming starter gear that described programming tool provides power management (5) to link to each other with described microcontroller chip, operate in order to start offline programming;
Especially, also comprise programming firmware code preservation unit in the microcontroller chip in the utility model, be used for storing the programming firmware code that downloads to described programming tool by described communication interface.
Described communication interface can adopt usb communication interface, serial communication interface or parallel port communication interface.
Described offline programming starter gear can adopt key device or switchgear.
Compared with prior art, the beneficial effects of the utility model are: the dual-purpose programming tool of the online/offline of the safety that the utility model provides, the firmware code that is programmed is changed in the microcontroller chip that is kept at programming tool self by the chip external memory that is kept in the existing programming tool, make it be not easy to be read out, thereby improved the security that is programmed firmware code greatly.
Embodiment
Below in conjunction with the drawings and specific embodiments the utility model is described in more detail.
Fig. 1 is the dual-purpose programming tool structural drawing of online/offline described in the utility model.With reference to figure 1, the dual-purpose programming tool 100 of safe online/offline described in the utility model comprises:
(1) microcontroller chip 102, comprise that self firmware code preserves unit 1021, wherein preserve programming tool 100 self firmware code, in order to control with realize objective chip is carried out programming operation; Also comprise programming firmware code preservation unit 1022, be used for storing the programming firmware code that downloads in the programming tool 100, self firmware code of firmware code and programming tool 100 of will programming like this is kept in the microcontroller chip 102 jointly, prevented that effectively the programming firmware code from being read easily, increased its security;
(2) communication interface 101, link to each other with microcontroller chip 102, and programming tool 100 is connected to computing machine 107, and the communication interface 101 here can adopt usb communication interface, serial communication interface or parallel port communication interface;
(3) the programming seat 103, in order to the installing objective chip;
(4) the state indicating module 106, link to each other with microcontroller chip 102, in order to indicate the duty of current programming tool and power supply thereof, generally come display working condition with pilot lamp and hummer;
(5) the offline programming starter gear 105, link to each other with microcontroller chip 102, in order to start the offline programming operation; Offline programming starter gear 105 can adopt key device or switchgear;
(6) electric power loop 104, be connected with microcontroller chip 102, communication interface 101 and programming seat 103, when adopting on-line mode work, programming tool 100 obtains power supply by communication interface 101, when adopting off-line mode work, programming tool 100 connects external power supply by the power interface in the electric power loop 104 and obtains power supply, for programming tool 100 provides power management.
Fig. 2 is a kind of preferred circuit connection layout of the dual-purpose programming tool of online/offline described in the utility model.With reference to figure 2, core devices on the circuit board of programming tool 200 comprises: microcontroller chip 202 (selecting the 68HC908JB16 chip of MOTOROLA company for use), usb communication interface 201, programming seat 203, power circuit 205, power interface 206, button 204, hummer 207, programming pilot lamp 208 and power light 209.
Workflow when adopting on-line mode to objective chip programming code is: at first objective chip is installed on the programming seat 203, again programming tool 200 is connected with computing machine 210 by usb communication interface 201, this moment, power light 209 was lighted, computing machine 210 can send a command information to the microcontroller chip 202 of programming tool 200 by usb communication interface 201, requires microcontroller chip 202 to check the model of the objective chip of the programming of wanting at present; After this moment, 202 inspections of microcontroller chip were installed in the model of the objective chip on the programming seat 203, give computing machine 210 with type information by 201 passbacks of usb communication interface, for example the model of the objective chip that reads of microcontroller chip 202 is ATMEL 89C51, then microcontroller chip 202 just can be to computing machine 210 these titles of passback, computing machine 210 judges whether the chip model on the programming seat 203 is effective chip, if the chip model that can utilize this programming tool 200 to carry out programming, just can programme to it, then report an error if not effective chip, this moment, hummer 207 meetings rang; If be installed on the programming seat 203 without any chip, just can return to 210 1 signals without any chip of computing machine, this moment, hummer 207 also can ring; The model of confirming objective chip in identification is for after effective, just can use upper layer software (applications) control programming instrument 200 on computing machine 210, by usb communication interface 201 will with the corresponding programming firmware code of objective chip under the control of microcontroller chip 202 directly programming be installed in the objective chip on the programming seat 203.In the programming process, programming pilot lamp 208 is lighted, and expression this moment, programming tool 200 was in programming state, if go wrong in the programming operation, just then hummer 207 can pipe and reports an error; Adopting in the whole process of on-line mode to objective chip programming code, all is to power by 201 pairs of programming tools 200 of usb communication interface.
Workflow when adopting off-line mode to objective chip programming code is: at first programming tool 200 is connected with computing machine 210 by usb communication interface 201, light power light 209, computing machine 210 just can be preserved downloading in the microcontroller chip 202 on the programming tool 200 by usb communication interface 201 with the corresponding programming firmware code of objective chip, just can disconnect the usb communication interface 201 that is connected with computer terminal 210 afterwards, this moment, power light 209 extinguished; When needs during to the objective chip programming, objective chip is installed on the programming seat 203 earlier, again power lead is received on the power interface 206, utilize interior power supply circuit 205 to power for microcontroller chip 202, programming seat 203, power light 209 is lighted; Press the action of button 204 startup offline programmings then, this moment, microcontroller chip 202 was by detecting the wherein level state of certain I/O pin (as I/O0), judge whether button 204 is pressed, this I/O0 pin is in low level state at ordinary times, when button was pressed, this I/O0 pin just can be in high level state, after button 204 is decontroled, this I/O0 pin can return to low level state again, finishes the action that one-touch is pressed; Microcontroller chip 202 is checked the model that is installed in the objective chip on the programming seat 203, and judges whether the chip model on the programming seat 203 is effective chip, if can utilize programming tool 200 to carry out the chip model of programming, just can programme to it; If not effective chip, then hummer 207 reports an error; If be installed on the programming seat 203 without any chip, hummer 207 also can report an error; Identification confirm the objective chip model be effectively after, be kept in the microcontroller chip 202 the programming firmware code just by programming in the objective chip that is installed in the programming 203, finish program burn writing to objective chip; In programming process, programming pilot lamp 208 is lighted, and expression programming tool 200 this moment is in programming state, if go wrong in the programming operation, then hummer 207 can pipe and report an error; Under whole off-line mode to all being to power by power interface 206 in the process of objective chip programming program code by external power supply.
In the present embodiment, microcontroller chip 68HC908JB16 has 16KB FLASH storage space, allocation scheme is that wherein 8KB storage space is used for preserving programming tool self firmware program code, and other 8KB storage space is used for leaving in preserves the programming firmware program under the offline programming mode.Distribution for storage space in the practical application can be adjusted according to concrete needs.
In the present embodiment, what the offline programming starter gear adopted is that button is realized, certainly, also can adopt switchgear to realize the startup that offline programming is moved.
In the present embodiment, because the programming firmware code of objective chip is to preserve among the microcontroller chip 68HC908JB16 that downloads on the programming tool, so the general mode that is kept at chip external memory spare is not easy to be read out more relatively at present, has improved security.
The above embodiment only is a preferred embodiment of the present utility model; the utility model is not limited to the foregoing description; for persons skilled in the art; the any conspicuous change of under the prerequisite that does not deviate from the utility model principle it being done all belongs to the protection domain of design of the present utility model and claims.