CN105487890A - Firmware downloading method based on C51 series single chip microcomputer kernel - Google Patents

Firmware downloading method based on C51 series single chip microcomputer kernel Download PDF

Info

Publication number
CN105487890A
CN105487890A CN201510835977.XA CN201510835977A CN105487890A CN 105487890 A CN105487890 A CN 105487890A CN 201510835977 A CN201510835977 A CN 201510835977A CN 105487890 A CN105487890 A CN 105487890A
Authority
CN
China
Prior art keywords
chip microcomputer
host computer
data
downloaded
single chip
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510835977.XA
Other languages
Chinese (zh)
Inventor
汪桂霞
韦清翰
刘素捧
侯绪同
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin Aviation Mechanical and Electrical Co Ltd
Original Assignee
Tianjin Aviation Mechanical and Electrical Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin Aviation Mechanical and Electrical Co Ltd filed Critical Tianjin Aviation Mechanical and Electrical Co Ltd
Priority to CN201510835977.XA priority Critical patent/CN105487890A/en
Publication of CN105487890A publication Critical patent/CN105487890A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44568Immediately runnable code
    • G06F9/44573Execute-in-place [XIP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a firmware downloading method based on a C51 series single chip microcomputer kernel. The method comprises: step 1, judging whether a downloading information control pin is in low level state by a single chip microcomputer; if so, executing step 2, or executing a source working program; step 2, starting executing an online downloading program Boot loader by the single chip microcomputer; step 3, sending identity identification ID numbers to an upper computer by the single chip microcomputer; step 4, receiving and analyzing the handshake character passwords sent through the upper computer according to the ID numbers by the single chip microcomputer; step 5, determining whether current channel software codes need to be updated by the single chip microcomputer according to the handshake character passwords; if so, executing step 6, or jumping out of the online downloading program Boot loader, executing the source working program; step 6, sending a data receiving request to the upper computer by the single chip microcomputer; step 7, receiving the responders sent through the upper computer according to the data receiving request by the single chip microcomputer; step 8, receiving and storing the data to be downloaded transmitted through the upper computer by the single chip microcomputer.

Description

A kind of firmware downloads method based on C51 series monolithic kernel
Technical field
The embodiment of the present invention relates to microcomputer development field, particularly relates to a kind of firmware downloads method based on C51 series monolithic kernel.
Background technology
Single-chip microcomputer adopts very large scale integration technology that various functional circuitry is integrated into the little and perfect microcomputer system of that one piece of silicon chip is formed, in industrial control field widespread use.
C8051 series monolithic is in occupation of the mass market of micro-control unit (MicrocontrollerUnit, MCU), and advantage such as general and cheap with it, by the first-selection that school and company develop as microcontroller.But C8051 series monolithic uses programmable device downloading object file, compared with the 32-bit microprocessors such as ARM, no matter this mode is the reliability from ease for use or program, all with the addition of inconvenience, make the tagger of C8051 series monolithic be difficult to accept.In addition, current product is in order to the convenience of debugging and safeguard, General Requirements can be communicated by UART when not dismantling single-chip microcomputer with the product of single-chip computer control system, CAN communication or other communication upgrade program, and in prior art, C8051 series monolithic can not meet the demand.
Summary of the invention
The invention provides a kind of firmware downloads method based on C51 series monolithic kernel, to realize the firmware download online based on C51 series monolithic kernel.
First aspect, embodiments provide a kind of firmware downloads method based on C51 series monolithic kernel, the method comprises:
Step 1, single-chip microcomputer judge that Download Info controls whether pin is low level state, if so, performs step 2, if not, perform source working routine;
Step 2, single-chip microcomputer start to perform download online program Bootloader;
Step 3, single-chip microcomputer send No. ID, identify label to host computer;
Step 4, single-chip microcomputer receive and resolve host computer according to described No. ID character password of shaking hands sent;
Step 5, single-chip microcomputer according to described in shake hands character password determination current channel software code the need of renewal, if so, perform step 6, if not, jump out download online program Bootloader, perform source working routine;
Step 6, single-chip microcomputer send data receiver request to host computer;
Step 7, single-chip microcomputer receive the response word that host computer sends according to described data receiver request;
Step 8, single-chip microcomputer receive and store the data to be downloaded of host computer transmission.
Second aspect, embodiments provide a kind of firmware downloads method based on C51 series monolithic kernel, the method comprises:
Data ordering to be downloaded is recombinated by step 1, host computer, obtains continuously and press the data to be downloaded that execution sequence arranges;
Step 2, host computer obtain the byte length of the rear data to be downloaded of arrangement restructuring;
Step 3, host computer judge whether No. ID, the passage single-chip microcomputer identify label receiving coupling, if so, perform step 4, if not, continue to wait for;
Step 4, host computer send to respective channel single-chip microcomputer character password of shaking hands;
Step 5, host computer judge whether the data receiver request receiving single-chip microcomputer, if so, perform step 6, if not, continue to wait for;
Step 6, host computer send response word according to described data receiver request to respective channel single-chip microcomputer;
Step 7, host computer send the byte length of described data to be downloaded to respective channel single-chip microcomputer;
Step 8, host computer send described data to be downloaded.
The technical scheme that the embodiment of the present invention provides, self ID number is sent to host computer by single-chip microcomputer, receive the character password of shaking hands that host computer is replied, and after determining that this passage software code needs renewal according to the analysis result of described character password of shaking hands, data receiver request is sent to host computer, final reception and store host computer send data to be downloaded, at the firmware download online without the need to achieving when scrambler based on C51 series monolithic kernel, simplify single-chip microcomputer firmware downloads process.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the firmware downloads method based on C51 series monolithic kernel that the embodiment of the present invention one provides;
Fig. 2 is the schematic flow sheet of the firmware downloads method based on C51 series monolithic kernel that the embodiment of the present invention two provides;
Fig. 3 a is the first serial telecommunication circuit schematic diagram that the embodiment of the present invention three provides;
Fig. 3 b is the second serial telecommunication circuit schematic diagram that the embodiment of the present invention three provides;
Fig. 3 c is the single chip circuit schematic diagram that the embodiment of the present invention three provides;
Fig. 4 is the upper computer software surface chart that the embodiment of the present invention three provides.
Embodiment
Below in conjunction with drawings and Examples, the present invention is described in further detail.Be understandable that, specific embodiment described herein is only for explaining the present invention, but not limitation of the invention.It also should be noted that, for convenience of description, illustrate only part related to the present invention in accompanying drawing but not full content.Before in further detail exemplary embodiment being discussed, it should be mentioned that some exemplary embodiments are described as the process or method described as process flow diagram.Although operations (or step) is described as the process of order by process flow diagram, many operations wherein can be implemented concurrently, concomitantly or simultaneously.In addition, the order of operations can be rearranged.Described process can be terminated when its operations are completed, but can also have the additional step do not comprised in the accompanying drawings.Described process can correspond to method, function, code, subroutine, subroutine etc.
Embodiment one
Fig. 1 is the schematic flow sheet of the firmware downloads method based on C51 series monolithic kernel that the embodiment of the present invention one provides.The present embodiment is applicable to the online programming of C51 series monolithic.The method can be performed by the firmware downloads device based on C51 series monolithic kernel, and this device realizes by the mode of hardware and/or software, and general accessible site is in C51 series monolithic.
See Fig. 1, the firmware downloads method based on C51 series monolithic kernel that the present embodiment provides specifically can comprise as follows:
Step 110, single-chip microcomputer judge that Download Info controls whether pin is low level state, if so, performs step 120, if not, perform source working routine;
What the present embodiment adopted is C51 series monolithic, determines that execution source working routine still performs download online program by the level state regulating Download Info to control pin.Wherein, the program performed when described source working routine refers to that single-chip microcomputer normally works, be relatively independent with described download online program, single-chip microcomputer only performs one of them program in a period of time.Owing to being two independently programs, in support program downloading process, occur that abnormal interrupt (as: abnormal power-down) can recover download function again.
Step 120, single-chip microcomputer start to perform download online program Bootloader;
It is after low level state that single-chip microcomputer determination Download Info controls pin, starts to perform download online program Bootloader, and described BootLoader is used for the hardware environment of system to adjust to suitable state.
Step 130, single-chip microcomputer send No. ID, identify label to host computer;
Every platform host computer can corresponding multiple single-chip microcomputer, the communication of each single-chip microcomputer and host computer uses a specific passage, No. ID, the identification needing the single-chip microcomputer realizing firmware download online self to be different from other single-chip microcomputers by corresponding communication port sends to host computer, so that host computer determination single-chip microcomputer identity.
Step 140, single-chip microcomputer receive and resolve host computer according to described No. ID character password of shaking hands sent;
The self ID number that host computer sends according to single-chip microcomputer carries out information-reply, and for ensuring communication safety, host computer is encrypted return information, with the form of character password of shaking hands, return information is sent to the single-chip microcomputer of respective channel.Single-chip microcomputer is resolved it after receiving the character password of shaking hands of host computer transmission.
Step 150, single-chip microcomputer according to described in shake hands character password determination current channel software code the need of renewal, if so, perform step 160, if not, jump out download online program Bootloader, perform source working routine;
Single-chip microcomputer according to described in shake hands the analysis result of character password, the instruction current channel software code that character password of shaking hands described in acquisition carries is the need of the information upgraded, if determine that current channel software code does not need to upgrade according to host computer instruction, then jump out download online program Bootloader, transfer execution source working routine to, if determine that current channel software code needs to upgrade according to host computer instruction, then continue to perform follow-up download online program.
Step 160, single-chip microcomputer send data receiver request to host computer;
According to host computer instruction, single-chip microcomputer determines that current channel software code needs renewal after, storer for storing data to be downloaded is wiped and allows to write storer, in order to set up communication link, single-chip microcomputer can by auto-baud-detect determination bit rate, also can use and make a reservation for consistent baud rate with host computer, once single-chip microcomputer has been ready to receive namely data send reception request from data to be downloaded to host computer.
Step 170, single-chip microcomputer receive the response word that host computer sends according to described data receiver request;
Single-chip microcomputer receives the response word that host computer sends according to described data receiver request, determines that described data receiver request is passed through by host computer, and data to be downloaded are about to start transmission.
Step 180, single-chip microcomputer receive and store the data to be downloaded of host computer transmission.
After single-chip microcomputer receives the response word of host computer transmission, receive the data to be downloaded of host computer transmission, and arranged in sequence is stored in position corresponding to storer.
Further, single-chip microcomputer also comprises before judging whether Download Info control pin is low level state:
Single-chip microcomputer initialization related software and hardware, and configure RS422 communication.
The present embodiment adopts RS422 communication mode to realize the communication of single-chip microcomputer and host computer, after connecting hardware circuit, need first to carry out initialization to relevant software and hardware, and configure RS422 communication, comprise the peripheral hardware and input/output end port pin that are configured for downloading data, for the implementation of down-stream is ready.
It should be noted that, first time writes online loading source code to single-chip microcomputer to be needed to realize by scrambler, follow-up renewal or when safeguarding the source code of single-chip microcomputer, by RS422 serial communication download online.
In the present embodiment, single-chip microcomputer can also comprise before sending data receiver request to host computer:
Single-chip microcomputer requires erasing FLASH data storage area according to the byte that host computer sends; Accordingly,
Single-chip microcomputer receives and stores the data to be downloaded of host computer transmission, comprising:
It take 2ms as two bytes in the data to be downloaded sent in turn in the time interval that single-chip microcomputer receives host computer successively;
Single-chip microcomputer successively by two bytes store in the data described to be downloaded that receive to FLASH data storage area appropriate address.
The present embodiment uses the FLASH data storage area of single-chip microcomputer to deposit data to be downloaded.First erasing process is carried out to FLASH data storage area, it should be noted that, the region that FLASH data storage area is wiped free of is can deposit based on data to be downloaded, and single-chip microcomputer receives the data word joint number to be downloaded that host computer sends, and according to described byte number erasing FLASH data storage area.It should be noted that in single-chip microcomputer that erase operation is write allows position and erasing to allow position to be set to 1, to ensure that erasing and write operation normally can be carried out in FLASH data storage area.In addition, use restriction during FLASH data storage area to be the speed performing write operation, complete the time of the longest 60 μ s of the action need writing a byte, therefore the transfer rate of host computer can not be too high.The present embodiment host computer selects the time interval batchwise transfer data to be downloaded of 2ms, the often a collection of data to be downloaded comprising two bytes, single-chip microcomputer receives the data to be downloaded that host computer sends, and store data in the correspondence position of FLASH data storage area successively, make stored in the data ordering order in FLASH data storage area identical with the order that host computer sends data to be downloaded.
Account at the present embodiment, single-chip microcomputer receive and store host computer transmission data to be downloaded after, can also comprise:
Single-chip microcomputer reads data in FLASH data storage area, and sends to host computer to verify;
Single-chip microcomputer sends to host computer the Bootloader termination character that downloads online;
Single-chip microcomputer cuts out RS422 communication.
For determining that the data be stored in FLASH data storage area are accurately, after single-chip microcomputer receives the data to be downloaded of host computer transmission, read the data in FLASH data storage area, and send to host computer to verify, judge whether that the data be stored in FLASH data storage area are data to be downloaded of complete and accurate.After determining that check results is correct, single-chip microcomputer sends the Bootloader termination character that downloads online, to notify that host computer procedure downloading process terminates to host computer.Last single-chip microcomputer cuts out RS422 communication, the communication process of end and host computer.
The technical scheme that the present embodiment provides, self ID number is sent to host computer by single-chip microcomputer, receive the character password of shaking hands that host computer is replied, and after determining that this passage software code needs renewal according to the analysis result of described character password of shaking hands, data receiver request is sent to host computer, final reception and store host computer send data to be downloaded, at the firmware download online without the need to achieving when scrambler based on C51 series monolithic kernel, simplify single-chip microcomputer firmware downloads process.
Embodiment two
Fig. 2 is the schematic flow sheet of the firmware downloads method based on C51 series monolithic kernel that the embodiment of the present invention two provides.The present embodiment is applicable to PC control and realizes C51 series monolithic online programming.The method can be performed by the firmware downloads device based on C51 series monolithic kernel, and this device realizes by the mode of hardware and/or software, and general accessible site is in host computer.
See Fig. 2, the firmware downloads method based on C51 series monolithic kernel that the present embodiment provides specifically can comprise as follows:
Data ordering to be downloaded is recombinated by step 210, host computer, obtains continuously and press the data to be downloaded that execution sequence arranges;
Data original to be downloaded in host computer are discontinuous, before transmission data to be downloaded, host computer needs to carry out arrangement restructuring to described original data to be downloaded, to obtain continuously and the data to be downloaded arranged by execution sequence, transmits for subsequent download Procedure Acquisition.What deserves to be explained is, because original data to be downloaded are HEX files, not the correct format that in single-chip microcomputer, FLASH data storage area stores data, so before transmitting the data, needing HEX file transform is BIN file layout, i.e. the data layout of FLASH data storage area storage.
Step 220, host computer obtain the byte length of the rear data to be downloaded of arrangement restructuring;
Host computer obtains the byte length of the rear data to be downloaded of arrangement restructuring, sends to single-chip microcomputer, informs the byte length of single-chip microcomputer data to be downloaded, single-chip microcomputer is wiped FLASH data storage area with reference to described byte length so that follow-up.
Step 230, host computer judge whether No. ID, the passage single-chip microcomputer identify label receiving coupling, if so, perform step 240, if not, continue to wait for;
Host computer needs to understand the single-chip microcomputer identity information receiving data to be downloaded, with with described single chip communication, therefore, host computer first will judge whether to receive and No. ID that sets single-chip microcomputer in passage that passage mates, if do not received, just continue to wait for, if having received, just respond respective channel single-chip microcomputer according to described No. ID.
Step 240, host computer send to respective channel single-chip microcomputer character password of shaking hands;
Determine to receive after No. ID that mates the transmission of passage single-chip microcomputer, host computer sends to described coupling passage single-chip microcomputer character password of shaking hands, by the mode of encryption, the indication information of download program is transferred to described coupling passage single-chip microcomputer, the software code that described indication information comprises this passage single-chip microcomputer needs to upgrade, or the software code of this passage single-chip microcomputer does not need to upgrade.
Step 250, host computer judge whether the data receiver request receiving single-chip microcomputer, if so, perform step 260, if not, continue to wait for;
When the single-chip microcomputer of described coupling passage determines that the software code of this passage single-chip microcomputer needs to upgrade, data receiver request can be sent to host computer; When the single-chip microcomputer of described coupling passage determines that the software code of this passage single-chip microcomputer does not need to upgrade, data receiver request can not be sent to host computer, therefore, host computer is by judging whether the data receiver request receiving single-chip microcomputer, respective channel single-chip microcomputer can be understood and whether receive instruction, and carry out the preparation of reception data according to described instruction or jump to source working routine.
Step 260, host computer send response word according to described data receiver request to respective channel single-chip microcomputer;
Host computer is received and after the data receiver request sent by single-chip microcomputer, can send response word, to notify that current channel single-chip microcomputer is about to start to send data to be downloaded to current channel single-chip microcomputer.
Step 270, host computer send the byte length of described data to be downloaded to respective channel single-chip microcomputer;
Before the described data to be downloaded of transmission, first host computer sends the data byte length to be downloaded of having added up to respective channel single-chip microcomputer, determine required region, FLASH data storage area to make respective channel single-chip microcomputer according to described byte length.
Step 280, host computer send described data to be downloaded.
Host computer sends according to the data to be downloaded preset and requires to send described data to be downloaded in batches.
Further, host computer, by before data ordering restructuring to be downloaded, also comprises:
Host computer initialization global variable.
In the present embodiment, the described data to be downloaded of host computer transmission can comprise:
Host computer is according to each endian of described data to be downloaded after arrangement restructuring, obtain two bytes in data to be downloaded successively, be the time interval send to current channel single-chip microcomputer in turn with 2ms, and empty described transmit buffer before each acquisition two byte datas.
Host computer data rate is more a lot of soon than single-chip data writing speed, for avoiding the data congestion of single-chip microcomputer end, the present embodiment enables transmission data buffer, the data to be downloaded of two bytes are captured successively from data bus, put into described transmission data buffer, treat that delay time arrives, the byte data of two in transmission data buffer is sent to respective channel single-chip microcomputer, wherein, described delay time can be but be not limited to 2ms.At every turn from before data bus captures the data to be downloaded of two bytes, all transmission data buffer will be emptied, to improve the accuracy of data transmission.It should be noted that, host computer is that the order after recombinating according to data ordering to be downloaded carries out data grabber.
In the present embodiment, host computer can also comprise after sending described data to be downloaded:
The code data that host computer reception respective channel single-chip microcomputer reads in its FLASH data storage area verifies;
Host computer receives the download online program Bootloader termination character that respective channel single-chip microcomputer sends.
The data content to be downloaded sent for the data of guaranteeing to be stored in single-chip microcomputer FLASH data storage area and host computer and put in order identical, the code data that host computer reception single-chip microcomputer reads in its FLASH data storage area verifies, concrete, described checking procedure can be the code data of acceptance mated with the data trnascription to be downloaded of transmission, if the match is successful, prompting check results is correct, if mate unsuccessful, and prompting check results mistake.After determining that check results is correct, notice single-chip microcomputer, and accept the download online program Bootloader termination character of single-chip microcomputer transmission, terminate download online process.
In the present embodiment, after host computer obtains the byte length of the rear data to be downloaded of arrangement restructuring, also bag can be drawn together: PC control first pilot lamp lights;
Host computer can also comprise: PC control second pilot lamp lights after judging whether to receive the data receiver request of single-chip microcomputer;
Host computer can also comprise: PC control the 3rd pilot lamp lights after sending described data to be downloaded.
After the code data that host computer reception respective channel single-chip microcomputer reads in its FLASH data storage area verifies, can also comprise: host computer judges that check results is correct, control the 4th pilot lamp and light;
Host computer can also comprise: PC control the 5th pilot lamp lights after receiving the download online program Bootloader termination character of respective channel single-chip microcomputer transmission.
For the implementation progress of prompting firmware download online process, the present embodiment devises five pilot lamp, and is separately positioned on corresponding step in described program download process and lights after completing.
The technical scheme that the present embodiment provides, the self ID number of coupling passage single-chip microcomputer transmission is received by host computer, to shake hands character password according to described ID reply, and after the data receiver request receiving the transmission of described single-chip microcomputer, data to be downloaded are sent to described single-chip microcomputer, at the firmware download online without the need to achieving when scrambler based on C51 series monolithic kernel, simplify single-chip microcomputer firmware downloads process.
Embodiment three
The present embodiment as the specific embodiment of above-described embodiment, for C8051F502 single-chip microcomputer, further specific explanations technical solution of the present invention.
One, signal wiring
Fig. 3 a is the first serial telecommunication circuit schematic diagram that the embodiment of the present invention three provides.As shown in Figure 3 a, adopt ADUM1201CR type numeral isolating chip 311 as the master chip of first serial circuit.Described first serial circuit is mainly used in the noise in filtering signal transmission, wherein, diode 312 is for preventing short circuit between hyperchannel, resistance 313 is for current limliting, avoid the excessive damage causing digital isolating chip of bus current, concrete, in the present embodiment, bus current can within tolerance range at ADUM1201CR type numeral isolating chip 311, therefore, resistance 313 resistance is set to 0.Further, corresponding different bus, the resistance of resistance 313 can regulate according to actual needs.VDD1314 with VDD2315 two pins are connected power supply, for ADUM1201CR type numeral isolating chip 311 provides the power supply needed for normal work.
Fig. 3 b is the second serial telecommunication circuit schematic diagram that the embodiment of the present invention three provides.As shown in Figure 3 b, adopt MAX3086EESD type transponder chip 321 as the master chip of second serial circuit, described second serial circuit is mainly used in receiving and sending signal of communication.Be the feed circuit 322 of described MAX3086EESD type transponder chip 321 in the dotted line frame of right side, normally to work required power supply for providing chip, be the differential signal delivery circuit 323 of described MAX3086EESD type transponder chip in the empty frame in left side, for transmission, difference processing carried out to signal transmission.The DE pin 3300 of described MAX3086EESD type transponder chip 321 is information transmission Enable Pin, and when this pin is high level, chip can carry out information transmission.The GND pin 3301 that described MAX3086EESD type transponder chip 321 connects 5V power supply is receives information Enable Pin, and when this pin is low level, chip can carry out receives information.
Fig. 3 c is the single chip circuit schematic diagram that the embodiment of the present invention three provides.As shown in Figure 3 c, adopt C8051F502 type single-chip microcomputer 331, described C8051F502 type single-chip microcomputer 331 belongs to C8051 series monolithic.Being the feed circuit 332 of single-chip microcomputer in the dotted line frame of right side, normally working required power supply for providing single-chip microcomputer.
The concrete annexation of above-mentioned three circuit is: C8051F502 type single-chip microcomputer 331P0.4333 with P0.5334 two pins are connected ADUM1201CR type numeral isolating chip 311VIA316 and VOB317 two pins respectively; ADUM1201CR type numeral isolating chip 311VOA318 with VIB319 two pins are connected MAX3086EESD type transponder chip 321RO324 and DI325 pin respectively by diode 312 with resistance 313; A326, B327, Z328 and Y329 tetra-pins of MAX3086EESD type transponder chip 321 show to link by described differential signal delivery circuit 323 and ripple and connect host computer.
Two, host computer interface
Fig. 4 is the upper computer software surface chart that the embodiment of the present invention three provides.Upper computer software interface shown in Fig. 4 obtains based on the firmware downloads method based on C51 series monolithic kernel described in the above-mentioned signal wiring of the present embodiment and embodiment one and embodiment two, more specifically can understand single-chip microcomputer and the host computer communication information from this upper computer software interface.
The technical scheme that the present embodiment provides, by for C8051F502 single-chip microcomputer, in conjunction with the software interface of concrete hardware circuit principle figure and correspondence, further illustrate technical solution of the present invention, achieve when without the need to when scrambler based on the firmware download online of C51 series monolithic kernel.
Note, above are only preferred embodiment of the present invention and institute's application technology principle.Skilled person in the art will appreciate that and the invention is not restricted to specific embodiment described here, various obvious change can be carried out for a person skilled in the art, readjust and substitute and can not protection scope of the present invention be departed from.Therefore, although be described in further detail invention has been by above embodiment, the present invention is not limited only to above embodiment, when not departing from the present invention's design, can also comprise other Equivalent embodiments more, and scope of the present invention is determined by appended right.

Claims (9)

1., based on a firmware downloads method for C51 series monolithic kernel, it is characterized in that, comprising:
Step 1, single-chip microcomputer judge that Download Info controls whether pin is low level state, if so, performs step 2, if not, perform source working routine;
Step 2, single-chip microcomputer start to perform download online program Bootloader;
Step 3, single-chip microcomputer send No. ID, identify label to host computer;
Step 4, single-chip microcomputer receive and resolve host computer according to described No. ID character password of shaking hands sent;
Step 5, single-chip microcomputer according to described in shake hands character password determination current channel software code the need of renewal, if so, perform step 6, if not, jump out download online program Bootloader, perform source working routine;
Step 6, single-chip microcomputer send data receiver request to host computer;
Step 7, single-chip microcomputer receive the response word that host computer sends according to described data receiver request;
Step 8, single-chip microcomputer receive and store the data to be downloaded of host computer transmission.
2. method according to claim 1, is characterized in that, single-chip microcomputer also comprises before judging whether Download Info control pin is low level state:
Single-chip microcomputer initialization related software and hardware, and configure RS422 communication.
3. method according to claim 2, is characterized in that, single-chip microcomputer also comprises before sending data receiver request to host computer:
Single-chip microcomputer requires erasing FLASH data storage area according to the byte that host computer sends; Accordingly,
Single-chip microcomputer receives and stores the data to be downloaded of host computer transmission, comprising:
It take 2ms as two bytes in the data to be downloaded sent in turn in the time interval that single-chip microcomputer receives host computer successively;
Single-chip microcomputer successively by two bytes store in the data described to be downloaded that receive to FLASH data storage area appropriate address.
4. method according to claim 3, is characterized in that, single-chip microcomputer receive and store host computer transmission data to be downloaded after, also comprise:
Single-chip microcomputer reads data in FLASH data storage area, and sends to host computer to verify;
Single-chip microcomputer sends to host computer the Bootloader termination character that downloads online;
Single-chip microcomputer cuts out RS422 communication.
5., based on a firmware downloads method for C51 series monolithic kernel, it is characterized in that, comprising:
Data ordering to be downloaded is recombinated by step 1, host computer, obtains continuously and press the data to be downloaded that execution sequence arranges;
Step 2, host computer obtain the byte length of the rear data to be downloaded of arrangement restructuring;
Step 3, host computer judge whether No. ID, the passage single-chip microcomputer identify label receiving coupling, if so, perform step 4, if not, continue to wait for;
Step 4, host computer send to respective channel single-chip microcomputer character password of shaking hands;
Step 5, host computer judge whether the data receiver request receiving single-chip microcomputer, if so, perform step 6, if not, continue to wait for;
Step 6, host computer send response word according to described data receiver request to respective channel single-chip microcomputer;
Step 7, host computer send the byte length of described data to be downloaded to respective channel single-chip microcomputer;
Step 8, host computer send described data to be downloaded.
6. method according to claim 5, is characterized in that, host computer, by before data ordering restructuring to be downloaded, also comprises:
Host computer initialization global variable.
7. method according to claim 5, is characterized in that, host computer sends described data to be downloaded and comprises:
Host computer is according to each endian of described data to be downloaded after arrangement restructuring, obtain two bytes in residue data to be downloaded successively, be the time interval send to current channel single-chip microcomputer in turn with 2ms, and empty described transmit buffer before each acquisition two byte datas.
8. method according to claim 5, is characterized in that, host computer also comprises after sending described data to be downloaded:
The code data that host computer reception respective channel single-chip microcomputer reads in its FLASH data storage area verifies;
Host computer receives the download online program Bootloader termination character that respective channel single-chip microcomputer sends.
9. method according to claim 8, is characterized in that:
Host computer also comprises: PC control first pilot lamp lights after obtaining the byte length of the rear data to be downloaded of arrangement restructuring;
Host computer also comprises: PC control second pilot lamp lights after judging whether to receive the data receiver request of single-chip microcomputer;
Host computer also comprises: PC control the 3rd pilot lamp lights after sending described data to be downloaded.
After the code data that host computer reception respective channel single-chip microcomputer reads in its FLASH data storage area verifies, also comprise: host computer judges that check results is correct, control the 4th pilot lamp and light;
Host computer also comprises: PC control the 5th pilot lamp lights after receiving the download online program Bootloader termination character of respective channel single-chip microcomputer transmission.
CN201510835977.XA 2015-11-25 2015-11-25 Firmware downloading method based on C51 series single chip microcomputer kernel Pending CN105487890A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510835977.XA CN105487890A (en) 2015-11-25 2015-11-25 Firmware downloading method based on C51 series single chip microcomputer kernel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510835977.XA CN105487890A (en) 2015-11-25 2015-11-25 Firmware downloading method based on C51 series single chip microcomputer kernel

Publications (1)

Publication Number Publication Date
CN105487890A true CN105487890A (en) 2016-04-13

Family

ID=55674886

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510835977.XA Pending CN105487890A (en) 2015-11-25 2015-11-25 Firmware downloading method based on C51 series single chip microcomputer kernel

Country Status (1)

Country Link
CN (1) CN105487890A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201626A (en) * 2016-07-20 2016-12-07 合肥联信电源有限公司 A kind of implementation method of automatic download fire-fighting emergent display lamp program
CN106292369A (en) * 2016-09-09 2017-01-04 南京玛锶腾智能科技有限公司 The dcs of steering wheel and method
CN107451015A (en) * 2017-08-08 2017-12-08 四川长虹电器股份有限公司 A kind of intelligent television critical data backup and data reconstruction method
CN110347417A (en) * 2019-07-11 2019-10-18 南京沁恒微电子股份有限公司 The IAP programme upgrade method of fixed vector table MCU
CN111123819A (en) * 2019-12-04 2020-05-08 山西诚鹏科技开发有限公司 PLC operation data recording method based on master-slave station communication mode
CN113760806A (en) * 2021-11-09 2021-12-07 南京沁恒微电子股份有限公司 Multi-mode virtual serial port chip, implementation method, firmware downloading system and method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040010677A1 (en) * 2002-07-10 2004-01-15 Samsung Electronics Co., Ltd. Method and apparatus for downloading program by using hand shaking in digital signal processing
CN1804799A (en) * 2005-01-12 2006-07-19 华为技术有限公司 SCM online loading and updating method and system
CN101315812A (en) * 2008-03-20 2008-12-03 上海交通大学 FLASH memory on-line programming method based on parallel port
CN102495744A (en) * 2011-11-29 2012-06-13 湖南南车时代电动汽车股份有限公司 Control software upgrading method of electronic control devices of electric automobile based on controller area network (CAN) bus
CN103019755A (en) * 2011-09-26 2013-04-03 东莞易步机器人有限公司 Wireless program downloading method of plurality of central processing units (CPUs) in embedded system
CN103336701A (en) * 2013-06-20 2013-10-02 深圳麦克维尔空调有限公司 Intelligent guiding and upgrading method
CN103838588A (en) * 2012-11-20 2014-06-04 广州市暨华医疗器械有限公司 Method for conducting online program updating on AT90 single-chip microcomputer through CAN interface
CN104461633A (en) * 2014-12-10 2015-03-25 北京兆易创新科技股份有限公司 Single-chip offline programming unit and offline programming method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040010677A1 (en) * 2002-07-10 2004-01-15 Samsung Electronics Co., Ltd. Method and apparatus for downloading program by using hand shaking in digital signal processing
CN1804799A (en) * 2005-01-12 2006-07-19 华为技术有限公司 SCM online loading and updating method and system
CN101315812A (en) * 2008-03-20 2008-12-03 上海交通大学 FLASH memory on-line programming method based on parallel port
CN103019755A (en) * 2011-09-26 2013-04-03 东莞易步机器人有限公司 Wireless program downloading method of plurality of central processing units (CPUs) in embedded system
CN102495744A (en) * 2011-11-29 2012-06-13 湖南南车时代电动汽车股份有限公司 Control software upgrading method of electronic control devices of electric automobile based on controller area network (CAN) bus
CN103838588A (en) * 2012-11-20 2014-06-04 广州市暨华医疗器械有限公司 Method for conducting online program updating on AT90 single-chip microcomputer through CAN interface
CN103336701A (en) * 2013-06-20 2013-10-02 深圳麦克维尔空调有限公司 Intelligent guiding and upgrading method
CN104461633A (en) * 2014-12-10 2015-03-25 北京兆易创新科技股份有限公司 Single-chip offline programming unit and offline programming method

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
周天兵等: "单片机程序远程升级技术", 《仪表技术》 *
王黎明: "《嵌入式系统开发与应用实验指导书 基于Cortex-M3内核的Stellaris微控制器》", 30 September 2013, 清华大学出版社 *
谭军等: "通用ECU在线升级系统的研究与设计", 《科技信息》 *
赵小录等: "C8051F410单片机BootLoader的实现", 《电子设计工程》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201626A (en) * 2016-07-20 2016-12-07 合肥联信电源有限公司 A kind of implementation method of automatic download fire-fighting emergent display lamp program
CN106292369A (en) * 2016-09-09 2017-01-04 南京玛锶腾智能科技有限公司 The dcs of steering wheel and method
CN106292369B (en) * 2016-09-09 2019-02-15 江苏新辰海智能科技有限公司 The dcs and method of steering engine
CN107451015A (en) * 2017-08-08 2017-12-08 四川长虹电器股份有限公司 A kind of intelligent television critical data backup and data reconstruction method
CN110347417A (en) * 2019-07-11 2019-10-18 南京沁恒微电子股份有限公司 The IAP programme upgrade method of fixed vector table MCU
CN110347417B (en) * 2019-07-11 2023-08-29 南京沁恒微电子股份有限公司 IAP program upgrading method for MCU of fixed vector table
CN111123819A (en) * 2019-12-04 2020-05-08 山西诚鹏科技开发有限公司 PLC operation data recording method based on master-slave station communication mode
CN113760806A (en) * 2021-11-09 2021-12-07 南京沁恒微电子股份有限公司 Multi-mode virtual serial port chip, implementation method, firmware downloading system and method

Similar Documents

Publication Publication Date Title
CN105487890A (en) Firmware downloading method based on C51 series single chip microcomputer kernel
US6892216B2 (en) Common platform for use in automotive services
CN101330399A (en) Method for upgrading built-in equipment
CN102662697B (en) Software upgrading method and device
CN102945173A (en) User program on-line upgrading system and method
KR101640207B1 (en) Bootloader and embedded system upgrade method
CN104679559A (en) Single chip microcomputer on-line programming method
CN107678765A (en) A kind of online upgrading method based on C8051F series monolithics
CN105094877A (en) Method for firmware upgrading, and host side device and system
CN104111844A (en) Method and system for installing application programs into mobile terminals
CN103064695A (en) Dynamic loading system of field-programmable gate array and loading method thereof
US20100241752A1 (en) Portable electronic device and method for downloading a firmware loader from a host computer
CN102711095A (en) Method for updating nodes of wireless sensor network in wireless mode
CN108037931B (en) Method for writing file in storage unit of microprocessor
CN112181455B (en) Online upgrading method of microcontroller, microcontroller and storage medium
CN110366038B (en) Method for multi-version software equipment to be compatible with multiple technical states
CN206892846U (en) A kind of program burn writing system of microcontroller built-in type system
CN110134423B (en) Firmware updating method and device and computer readable storage medium
CN101593123A (en) The curing of flash recordable plug-in component and terminal device
CN113360161A (en) Resource upgrading method and related product
CN101917395A (en) General upgrading method, device and system
CN104461633A (en) Single-chip offline programming unit and offline programming method
CN114691223B (en) Method and device for transmitting BIOS logs through network
CN106648697B (en) Method for lighting terminal and method for automatically controlling terminal
KR20200086480A (en) Firmware upgrading method of wireless charger and device using thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160413

RJ01 Rejection of invention patent application after publication