CN113672538B - USB-to-serial port chip and MCU firmware automatic downloading system and method thereof - Google Patents

USB-to-serial port chip and MCU firmware automatic downloading system and method thereof Download PDF

Info

Publication number
CN113672538B
CN113672538B CN202111240616.2A CN202111240616A CN113672538B CN 113672538 B CN113672538 B CN 113672538B CN 202111240616 A CN202111240616 A CN 202111240616A CN 113672538 B CN113672538 B CN 113672538B
Authority
CN
China
Prior art keywords
pin
usb
mcu
serial port
port 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.)
Active
Application number
CN202111240616.2A
Other languages
Chinese (zh)
Other versions
CN113672538A (en
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.)
Nanjing Qinheng Microelectronics Co ltd
Original Assignee
Nanjing Qinheng Microelectronics 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 Nanjing Qinheng Microelectronics Co ltd filed Critical Nanjing Qinheng Microelectronics Co ltd
Priority to CN202111240616.2A priority Critical patent/CN113672538B/en
Publication of CN113672538A publication Critical patent/CN113672538A/en
Application granted granted Critical
Publication of CN113672538B publication Critical patent/CN113672538B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4081Live connection to bus, e.g. hot-plugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/24Resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4204Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus
    • G06F13/4221Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being an input/output bus, e.g. ISA bus, EISA bus, PCI bus, SCSI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a USB-to-serial port chip and an automatic downloading system and method of MCU firmware thereof.A type variable pin of the USB-to-serial port chip is connected with a BootMode pin of an MCU, and the BootMode pin or the type variable pin is connected with a pull-up or pull-down resistor; and an output pin of the USB-to-serial port chip is connected with a reset pin of the MCU. The type variable pin defaults to be in an input state, when firmware needs to be downloaded, the upper computer sends a pin switching command, the type variable pin of the USB-to-serial port is switched to be in an output state and outputs the effective level of the BootMode pin, and then a request for resetting the MCU is sent, so that the MCU enters a firmware downloading mode; after the mode switching is completed, the type-variable pin restores the input state, and after the firmware downloading is completed, the pin is reset again, so that the MCU enters a user program mode. The invention does not need peripheral circuits, and the MCU can not mistakenly enter other modes, thereby realizing the automatic downloading of the firmware and improving the downloading efficiency.

Description

USB-to-serial port chip and MCU firmware automatic downloading system and method thereof
Technical Field
The invention belongs to the field of design of a USB-to-serial port chip, and particularly relates to a USB-to-serial port chip and an MCU firmware automatic downloading system and method thereof.
Background
Serial ports are widely used as downloading interfaces of MCU firmware, the starting modes of MCU are more and more, with the wider application range of MCU, the industry pays more attention to the downloading efficiency of MCU firmware and the volume cost of hardware circuit, and the economical and efficient firmware downloading method becomes more important.
Based on the requirement of 16C450/550, in the default state of the IO pin type of the general serial port chip, the CTS/DSR/RI/DCD pin is in the input direction, the RTS/DTR pin is in the output direction, and the default state is the high level state (232 level logic 0). In the prior art, the RTS/DTR is used as a mode selection pin to control a BootMode pin of the MCU, and when the MCU is reset, a start mode is determined according to a high/low level state of the mode selection pin. Taking an MCU with a low level as an example in a normal state of a mode pin, such as an MCU of 103 series, if a serial port is required to download firmware, the pin should be at a high level; if the user program needs to be run, the pin should be low. Therefore, the MCU starting mode can enter other starting modes along with the power-on and power-off of the serial port and the MCU, the serial port driver is not loaded, and the serial port is not opened, so that the use of the MCU is influenced. In order to avoid the problems, in the prior art, a resistor, a triode and other logic circuits are commonly added to assist the mutual exclusion and the level maintenance of the RTS/DTR of the serial port output pin so as to avoid entering a firmware downloading mode after power-on and reset.
At present, a computer is generally not provided with a serial port, and USB or PCI/PCIE and the like are adopted for serial port expansion, and then the computer is connected with an MCU for firmware downloading. How to realize the economical and efficient downloading of the MCU based on the USB-to-serial port chip is an urgent problem to be solved.
Disclosure of Invention
The purpose of the invention is as follows: in order to solve the problems in the prior art, the invention provides a USB-to-serial port chip, which can enable MCU firmware downloading based on the USB-to-serial port chip to be capable of solving the problem that an MCU enters a wrong starting mode under the condition of no peripheral circuit.
The invention also aims to provide a system and a method for automatically downloading the MCU firmware based on the USB-to-serial port chip.
The technical scheme is as follows: a USB-to-serial port chip comprises:
the type variable pin is an input pin in a default state, and can be switched into an output pin under a pin switching command of the upper computer and used for controlling a BootMode pin of the MCU;
the output pin is used for controlling a reset pin of the MCU;
when the processor receives a pin switching command sent by the upper computer, the software program can be executed: switching the type variable pin from an input pin to an output pin and outputting the effective level of the BootMode pin;
when the processor receives a pin recovery command sent by the upper computer, the software program can be executed to realize that: the type-changeable pin is restored to the input pin state.
Further, the pin switch command is a USB vendor command.
Further, the effective level of the BootMode pin is a high level or a low level, and when the BootMode pin of the MCU is normally a low level, the effective level is a high level; when the BootMode pin of the MCU is at a high level normally, the effective level is at a low level.
An MCU firmware automatic downloading system based on a USB-to-serial port chip comprises an upper computer, an MCU and the USB-to-serial port chip, wherein a type variable pin of the USB-to-serial port chip is connected with a BootMode pin of the MCU, and at least one of the BootMode pin of the MCU and the type variable pin of the USB-to-serial port chip is connected with a pull-down resistor or a pull-up resistor; an output pin of the USB-to-serial port chip is connected with a reset pin of the MCU; the upper computer is connected with the USB-to-serial port chip; the upper computer comprises a memory, a processor and a computer program which is stored on the memory and can be executed by the processor, and when a trigger condition is generated, the processor executes the computer program to realize the following steps in sequence:
sending a pin switching command to the USB-to-serial port chip, wherein the pin switching command is used for switching the type-variable pin of the USB-to-serial port chip from an input pin to an output pin and outputting the effective level of a BootMode pin;
sending a request for resetting the MCU to the USB-to-serial port chip, wherein the request for resetting the MCU refers to outputting an effective reset signal to an output pin of the USB-to-serial port chip;
sending a pin recovery command to the USB-to-serial port chip, wherein the pin recovery command is used for recovering the type-variable pins of the USB-to-serial port chip into an input pin state;
and after the firmware is downloaded, sending a request for resetting the MCU to the USB-to-serial port chip again.
Further, the trigger condition is an externally input download instruction signal, or a USB insertion motion is monitored.
Further, the effective level of the BootMode pin is a high level or a low level, when the BootMode pin of the MCU is normally a low level, the effective level is a high level, and the BootMode pin of the MCU or a type variable pin of the USB serial port conversion chip is connected with a pull-down resistor; when the BootMode pin of the MCU is at a high level in a normal state, the effective level is at a low level, and the BootMode pin of the MCU or the type variable pin of the USB-to-serial port chip is connected with a pull-up resistor.
A method for realizing MCU firmware automatic downloading by an upper computer controlling a USB-to-serial port chip comprises the following steps:
the host computer monitors whether a trigger condition is generated, and when the trigger condition is generated, the following steps are executed in sequence:
the upper computer sends a pin switching command to the USB serial-to-serial port chip, wherein the pin switching command is used for switching the type variable pin of the USB serial-to-serial port chip from an input pin to an output pin and outputting the effective level of a BootMode pin;
sending a request for resetting the MCU to the USB-to-serial port chip, wherein the request for resetting the MCU refers to outputting an effective reset signal to an output pin of the USB-to-serial port chip;
automatically executing a firmware downloading program; meanwhile, the upper computer sends a pin recovery command to the USB-to-serial port chip, and the type-variable pins of the USB-to-serial port chip are recovered to be in an input pin state;
and after the firmware is downloaded, sending a request for resetting the MCU to the USB-to-serial port chip again.
Further, the trigger condition is an externally input download instruction signal, or a USB insertion motion is monitored.
Further, the effective level of the BootMode pin is a high level or a low level, when the BootMode pin of the MCU is normally a low level, the effective level is a high level, and the BootMode pin of the MCU or a type variable pin of the USB serial port conversion chip is connected with a pull-down resistor; when the BootMode pin of the MCU is at a high level in a normal state, the effective level is at a low level, and the BootMode pin of the MCU or the type variable pin of the USB-to-serial port chip is connected with a pull-up resistor.
A method for realizing MCU firmware automatic downloading based on a USB-to-serial port chip comprises the following steps:
the upper computer monitors whether a trigger condition is generated, if the trigger condition is generated, the upper computer sends a pin switching command to the USB serial-to-serial port chip, the type-variable pin of the USB serial-to-serial port chip is switched from an input pin to an output pin and outputs the effective level of a BootMode pin, and the BootMode pin of the MCU is changed from a default level state to an effective level state;
the upper computer sends a request for resetting the MCU to the USB-to-serial port chip, an output pin of the USB-to-serial port chip outputs an effective reset signal, so that the reset pin of the MCU receives the effective reset signal, and the BootMode pin is an effective level when the MCU is reset, so that a firmware downloading mode is started;
automatically executing a firmware downloading program; the host computer sends a pin recovery command to the USB-to-serial port chip, and the type-variable pins of the USB-to-serial port chip are recovered to be in an input pin state;
after the firmware is downloaded, the upper computer sends a request for resetting the MCU to the USB-to-serial port chip again, so that a reset pin of the MCU receives an effective reset signal, and the BootMode pin is at a normal level when the MCU is reset, so that a user program mode is started.
Further, the trigger condition is an externally input download instruction signal, or a USB insertion motion is monitored.
The invention provides a USB-to-serial port chip and an MCU firmware automatic downloading system and method thereof, compared with the prior art, the USB-to-serial port chip and MCU firmware automatic downloading system and method have the following beneficial effects:
(1) the MCU cannot mistakenly enter an incorrect starting mode due to the conditions of power-on and power-off of the MCU and the serial port, no loading of a serial port driver, no opening of the serial port and the like, the starting mode of the MCU is automatically switched, manual participation or circuit assistance is not needed, and the stability of a product is better;
(2) the serial port is directly connected with the related pins of the MCU, so that logical control circuits such as resistors, triodes and the like are not required to be added, and the difficulty in debugging and production is avoided; no peripheral circuit is provided, so that the device cost and the manufacturing cost are saved, and the failure rate of the product is reduced;
(3) according to the USB hot plug characteristic, monitoring can be carried out at the software end of the upper computer, a downloading program can be automatically operated after the USB end is inserted, and the downloading program can be automatically closed after the USB end is pulled out, so that the automatic downloading effect of the serial port is realized, the firmware downloading efficiency is improved, and the use is more intelligent and convenient;
(4) the USB-to-serial port chip defaults that the level of a pin is high level, and the pin with variable type is used, so that the application that the BootMode pin of the MCU is normally low level can be realized; for the situation that the BootMode pin of the MCU is high level in normal state, the use of one output pin can be saved, and the application range of the MCU is expanded to a certain extent.
Drawings
Fig. 1 is a system block diagram of an MCU firmware automatic downloading system based on a USB to serial port chip.
Detailed Description
The invention is further explained below with reference to the figures and the specific embodiments.
The first embodiment is as follows:
in this embodiment, for example, the MCU with the BootMode pin normally at a low level is used, and when the BootMode pin is at a high level, the MCU resets to enter the firmware download mode.
A USB-to-serial port chip comprises:
the type-variable pin is an input pin in a default state, can be switched into an output pin under a pin switching command of the upper computer and is used for controlling a BootMode pin of the MCU, and the pin switching command is generally a USB manufacturer command;
the output pin is used for controlling a reset pin of the MCU;
when the processor receives a pin switching command sent by the upper computer, the software program can be executed: switching the type variable pin from an input pin to an output pin and outputting a high level;
when the processor receives a pin recovery command sent by the upper computer, the software program can be executed to realize that: the type-changeable pin is restored to the input pin state.
An automatic downloading system of MCU firmware based on USB to serial port chip is disclosed, as shown in FIG. 1, comprising an upper computer, an MCU and the USB to serial port chip, wherein the type-variable pin of the USB to serial port chip is connected with the BootMode pin of the MCU, and the BootMode pin of the MCU is connected with a pull-down resistor (generally 32-bit MCU standard, also can be connected with the type-variable pin of the USB to serial port chip); the boot mode1 pin of the MCU is connected with a fixed level pin of the USB-to-serial port chip (the pin is consistent with the prior art and is not described in detail); an output pin of the USB-to-serial port chip is connected with a reset pin of the MCU; the upper computer is connected with the USB-to-serial port chip; the upper computer comprises a memory, a processor and a computer program which is stored on the memory and can be executed by the processor, and when a trigger condition is generated, the processor executes the computer program to realize the following steps in sequence:
sending a pin switching command to the USB-to-serial port chip, wherein the pin switching command is used for switching the type-variable pin of the USB-to-serial port chip from an input pin to an output pin and outputting a high level;
sending a request for resetting the MCU to the USB-to-serial port chip, wherein the request for resetting the MCU refers to outputting an effective reset signal to an output pin of the USB-to-serial port chip;
sending a pin recovery command to the USB-to-serial port chip, wherein the pin recovery command is used for recovering the type-variable pins of the USB-to-serial port chip into an input pin state;
and after the firmware is downloaded, sending a request for resetting the MCU to the USB-to-serial port chip again.
The trigger condition in this embodiment is an externally input download instruction signal, such as a user clicking a download button on the upper computer software. Once a user clicks a download button on the upper computer software, the steps are automatically executed until the downloading of the firmware is finished, and manual other actions are not needed in the downloading process, so that the MCU firmware is automatically downloaded by one key.
The method for realizing the automatic downloading of the MCU firmware based on the USB-to-serial port chip comprises the following steps:
the upper computer monitors whether a trigger condition is generated, if the trigger condition is generated, the upper computer sends a pin switching command to the USB to serial port chip, the type-variable pin of the USB to serial port chip is switched from an input pin to an output pin and outputs a high level, and the BootMode pin of the MCU is changed from a default low level state to a high level state.
The upper computer sends a request for resetting the MCU to the USB-to-serial port chip, an output pin of the USB-to-serial port chip outputs an effective reset signal, the reset pin of the MCU receives the effective reset signal, and the BootMode pin is at a high level when the MCU is reset, so that a firmware downloading mode is started.
Automatically executing a firmware downloading program; and meanwhile, the upper computer sends a pin recovery command, and the type-variable pins of the USB-to-serial port are recovered to be in an input pin state. In this step, the type-variable pin can be restored to the input pin state as long as the MCU enters the firmware download mode.
After the firmware is downloaded, the upper computer sends a request for resetting the MCU to the USB-to-serial port chip again, so that a reset pin of the MCU receives an effective reset signal, the BootMode pin exits from the firmware downloading mode due to the low level during resetting of the MCU, and the user program mode is started.
Example two:
the difference between the second embodiment and the first embodiment is that the triggering condition is automatically generated when the USB insertion action is detected, and no manual operation is required. The upper computer monitors the USB end based on the characteristic of USB hot plug, when monitoring that the USB is inserted, a trigger condition is generated, the step of firmware downloading is automatically executed, until the firmware downloading is finished, the MCU exits the firmware downloading mode and enters a user program mode, the whole process does not need manual operation, and the MCU firmware is automatically downloaded.
Example three:
the difference between the third embodiment and the first embodiment is that, in the third embodiment, the MCU with the BootMode pin normally at a high level is taken as an example, and when the BootMode pin is at a low level, the MCU is reset to enter the firmware download mode.
A USB-to-serial port chip comprises:
the type-variable pin is an input pin in a default state, can be switched into an output pin under a pin switching command of the upper computer and is used for controlling a BootMode pin of the MCU, and the pin switching command is generally a USB manufacturer command;
the output pin is used for controlling a reset pin of the MCU;
when the processor receives a pin switching command sent by the upper computer, the software program can be executed: switching the type variable pin from an input pin to an output pin and outputting a low level;
when the processor receives a pin recovery command sent by the upper computer, the software program can be executed to realize that: the type-changeable pin is restored to the input pin state.
An MCU firmware automatic downloading system based on a USB-to-serial port chip is disclosed, as shown in FIG. 1, and comprises an upper computer, an MCU and the USB-to-serial port chip, wherein a type variable pin of the USB-to-serial port chip is connected with a BootMode pin of the MCU, and a pull-up resistor is connected to the BootMode pin of the MCU or the type variable pin of the USB-to-serial port chip; the BOOT1 pin of the MCU is connected to the fixed level pin of the USB serial port chip (which is the same as the prior art and not described in further detail); an output pin of the USB-to-serial port chip is connected with a reset pin of the MCU; the upper computer is connected with the USB-to-serial port chip; the upper computer comprises a memory, a processor and a computer program which is stored on the memory and can be executed by the processor, and when a trigger condition is generated, the processor executes the computer program to realize the following steps in sequence:
sending a pin switching command to the USB-to-serial port chip, wherein the pin switching command refers to switching the type-variable pins of the USB-to-serial port chip from input pins to output pins and outputting low level;
sending a request for resetting the MCU to the USB-to-serial port chip, wherein the request for resetting the MCU refers to outputting an effective reset signal to an output pin of the USB-to-serial port chip;
sending a pin recovery command to the USB-to-serial port chip, wherein the pin recovery command is used for recovering the type-variable pins of the USB-to-serial port chip into an input pin state;
and after the firmware is downloaded, sending a request for resetting the MCU to the USB-to-serial port chip again.
The trigger condition in this embodiment is an externally input download instruction signal, such as a user clicking a download button on the upper computer software. Once a user clicks a download button on the upper computer software, the steps are automatically executed until the downloading of the firmware is finished, and manual other actions are not needed in the downloading process, so that the MCU firmware is automatically downloaded by one key. Also, as in the second embodiment, the trigger condition is an automatic trigger for monitoring USB insertion.
The method for realizing the automatic downloading of the MCU firmware based on the USB-to-serial port chip comprises the following steps:
the upper computer monitors whether a trigger condition is generated, if the trigger condition is generated, the upper computer sends a pin switching command to the USB to serial port chip, the type-variable pin of the USB to serial port chip is switched from an input pin to an output pin and outputs a low level, and the BootMode pin of the MCU is changed from a default high level state to a low level state.
The upper computer sends a request for resetting the MCU to the USB-to-serial port chip, an output pin of the USB-to-serial port chip outputs an effective reset signal, the reset pin of the MCU receives the effective reset signal, and the BootMode pin is at a low level when the MCU is reset, so that a firmware downloading mode is started.
Automatically executing a firmware downloading program; and meanwhile, the upper computer sends a pin recovery command, and the type-variable pins of the USB-to-serial port are recovered to be in an input pin state. In this step, the type-variable pin can be restored to the input pin state as long as the MCU enters the firmware download mode.
After the firmware is downloaded, the upper computer sends a request for resetting the MCU to the USB-to-serial port chip again, so that a reset pin of the MCU receives an effective reset signal, the BootMode pin is at a high level when the MCU is reset, the MCU exits from the firmware downloading mode, and the user program mode is started.

Claims (10)

1. The utility model provides a USB changes serial ports chip which characterized in that includes:
the type variable pin is an input pin in a default state, and can be switched into an output pin under a pin switching command of the upper computer and used for controlling a BootMode pin of the MCU;
the output pin is used for controlling a reset pin of the MCU;
when the processor receives a pin switching command sent by the upper computer, the software program can be executed: switching the type variable pin from an input pin to an output pin and outputting the effective level of the BootMode pin;
when the processor receives a pin recovery command sent by the upper computer, the software program can be executed to realize that: the type-changeable pin is restored to the input pin state.
2. The USB-to-serial port chip according to claim 1, wherein the active level of the BootMode pin is a high level or a low level, and when the BootMode pin of the MCU is normally a low level, the active level is a high level; when the BootMode pin of the MCU is at a high level normally, the effective level is at a low level.
3. An MCU firmware automatic downloading system based on a USB-to-serial port chip is characterized by comprising an upper computer, an MCU and the USB-to-serial port chip as claimed in claim 1 or 2, wherein a type variable pin of the USB-to-serial port chip is connected with a BootMode pin of the MCU, and at least one of the BootMode pin of the MCU and the type variable pin of the USB-to-serial port chip is connected with a pull-down resistor or a pull-up resistor; an output pin of the USB-to-serial port chip is connected with a reset pin of the MCU; the upper computer is connected with the USB-to-serial port chip; the upper computer comprises a memory, a processor and a computer program which is stored on the memory and can be executed by the processor, and when a trigger condition is generated, the processor executes the computer program to realize the following steps in sequence:
sending a pin switching command to the USB-to-serial port chip, wherein the pin switching command is used for switching the type-variable pin of the USB-to-serial port chip from an input pin to an output pin and outputting the effective level of a BootMode pin;
sending a request for resetting the MCU to the USB-to-serial port chip, wherein the request for resetting the MCU refers to outputting an effective reset signal to an output pin of the USB-to-serial port chip;
sending a pin recovery command to the USB-to-serial port chip, wherein the pin recovery command is used for recovering the type-variable pins of the USB-to-serial port chip into an input pin state;
and after the firmware is downloaded, sending a request for resetting the MCU to the USB-to-serial port chip again.
4. The MCU firmware automatic downloading system based on USB-to-serial port chip of claim 3, wherein the trigger condition is an externally input downloading instruction signal or monitoring of USB insertion.
5. The MCU firmware automatic downloading system based on the USB to serial port chip according to claim 3 or 4, characterized in that the effective level of the BootMode pin is high level or low level, when the BootMode pin of the MCU is normally low level, the effective level is high level, the BootMode pin of the MCU or the type-variable pin of the USB to serial port chip is connected with a pull-down resistor; when the BootMode pin of the MCU is at a high level in a normal state, the effective level is at a low level, and the BootMode pin of the MCU or the type variable pin of the USB-to-serial port chip is connected with a pull-up resistor.
6. A method for realizing MCU firmware automatic downloading by an upper computer controlling a USB-to-serial port chip is characterized by comprising the following steps:
the host computer monitors whether a trigger condition is generated, and when the trigger condition is generated, the following steps are executed in sequence:
the upper computer sends a pin switching command to the USB serial-to-serial port chip, wherein the pin switching command is used for switching the type variable pin of the USB serial-to-serial port chip from an input pin to an output pin and outputting the effective level of a BootMode pin;
sending a request for resetting the MCU to the USB-to-serial port chip, wherein the request for resetting the MCU refers to outputting an effective reset signal to an output pin of the USB-to-serial port chip;
automatically executing a firmware downloading program; meanwhile, the upper computer sends a pin recovery command to the USB-to-serial port chip, and the type-variable pins of the USB-to-serial port chip are recovered to be in an input pin state;
and after the firmware is downloaded, sending a request for resetting the MCU to the USB-to-serial port chip again.
7. The method for the upper computer to control the USB-to-serial port chip to realize the automatic downloading of the MCU firmware according to claim 6, wherein the triggering condition is an externally input downloading instruction signal or monitoring a USB insertion action.
8. The method for the upper computer to control the USB to serial port chip to realize the automatic downloading of the MCU firmware according to claim 6 or 7, wherein the effective level of the BootMode pin is a high level or a low level, when the BootMode pin of the MCU is normally a low level, the effective level is a high level, and the BootMode pin of the MCU or the type-variable pin of the USB to serial port chip is connected with a pull-down resistor; when the BootMode pin of the MCU is at a high level in a normal state, the effective level is at a low level, and the BootMode pin of the MCU or the type variable pin of the USB-to-serial port chip is connected with a pull-up resistor.
9. A method for realizing MCU firmware automatic downloading based on a USB-to-serial port chip is characterized by comprising the following steps:
the upper computer monitors whether a trigger condition is generated, if the trigger condition is generated, the upper computer sends a pin switching command to the USB serial-to-serial port chip, the type-variable pin of the USB serial-to-serial port chip is switched from an input pin to an output pin and outputs the effective level of a BootMode pin, and the BootMode pin of the MCU is changed from a default level state to an effective level state;
the upper computer sends a request for resetting the MCU to the USB-to-serial port chip, an output pin of the USB-to-serial port chip outputs an effective reset signal, so that the reset pin of the MCU receives the effective reset signal, and the BootMode pin is an effective level when the MCU is reset, so that a firmware downloading mode is started;
automatically executing a firmware downloading program; the host computer sends a pin recovery command to the USB-to-serial port chip, and the type-variable pins of the USB-to-serial port chip are recovered to be in an input pin state;
after the firmware is downloaded, the upper computer sends a request for resetting the MCU to the USB-to-serial port chip again, so that a reset pin of the MCU receives an effective reset signal, and the BootMode pin is at a normal level when the MCU is reset, so that a user program mode is started.
10. The method according to claim 9, wherein the trigger condition is an externally input download command signal or monitoring a USB insertion action.
CN202111240616.2A 2021-10-25 2021-10-25 USB-to-serial port chip and MCU firmware automatic downloading system and method thereof Active CN113672538B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111240616.2A CN113672538B (en) 2021-10-25 2021-10-25 USB-to-serial port chip and MCU firmware automatic downloading system and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111240616.2A CN113672538B (en) 2021-10-25 2021-10-25 USB-to-serial port chip and MCU firmware automatic downloading system and method thereof

Publications (2)

Publication Number Publication Date
CN113672538A CN113672538A (en) 2021-11-19
CN113672538B true CN113672538B (en) 2022-02-15

Family

ID=78551037

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111240616.2A Active CN113672538B (en) 2021-10-25 2021-10-25 USB-to-serial port chip and MCU firmware automatic downloading system and method thereof

Country Status (1)

Country Link
CN (1) CN113672538B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103439901A (en) * 2013-08-08 2013-12-11 陕西科技大学 Program programming circuit universal to single chip microcomputer and embedded type microprocessor
CN203799373U (en) * 2014-03-04 2014-08-27 席卫平 Difunctional USB equipment
CN104317691A (en) * 2014-10-24 2015-01-28 中国重汽集团济南动力有限公司 Simulation debugging and code downloading tool
CN204480233U (en) * 2015-03-25 2015-07-15 广西机电职业技术学院 A kind of automatic download circuit of STC single-chip microcomputer supporting 5V and 3.3V

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103439901A (en) * 2013-08-08 2013-12-11 陕西科技大学 Program programming circuit universal to single chip microcomputer and embedded type microprocessor
CN203799373U (en) * 2014-03-04 2014-08-27 席卫平 Difunctional USB equipment
CN104317691A (en) * 2014-10-24 2015-01-28 中国重汽集团济南动力有限公司 Simulation debugging and code downloading tool
CN204480233U (en) * 2015-03-25 2015-07-15 广西机电职业技术学院 A kind of automatic download circuit of STC single-chip microcomputer supporting 5V and 3.3V

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
STM32程序的烧录方式与ISP一键下载;虾稿;《https://blog.csdn.net/tyler880/article/details/90311773》;20190518;第1-9页 *
USB 转串口芯片CH340;selflag;《https://wenku.baidu.com/view/fb0fb92d4b35eefdc8d333e3.html》;20121207;第1-5页 *

Also Published As

Publication number Publication date
CN113672538A (en) 2021-11-19

Similar Documents

Publication Publication Date Title
US9842036B2 (en) Methods and apparatus for controlled recovery of error information between independently operable processors
US9557791B2 (en) Computer device and method for converting working mode of universal serial bus connector of the computer device
US7613937B2 (en) Method and apparatus for utilizing a microcontroller to provide an automatic order and timing power and reset sequencer
CN110347625B (en) Method, device and equipment for switching GPU topology through wireless cable
US6477482B1 (en) Power button controlled diagnostic mode for an information appliance
US20090106609A1 (en) Semiconductor integrated circuit and debug mode determination method
US20070005949A1 (en) Method for Booting a Computer System
US20030204790A1 (en) Computer main board on/off testing device, method and system
US11579977B2 (en) Data storage device restoring method
CN111240753A (en) Loading method of bootstrap program, storage medium and embedded terminal
CN113672538B (en) USB-to-serial port chip and MCU firmware automatic downloading system and method thereof
US8412919B2 (en) Method for controlling multi-port network interface card
CN100521433C (en) Overheat protection circuit and system circuit board
US6892263B1 (en) System and method for hot swapping daughtercards in high availability computer systems
CN113760806B (en) Multi-mode virtual serial port chip, implementation method, firmware downloading system and method
CN111694340A (en) Automatic test fixture and method for PSU BootLoader
WO2021216046A1 (en) Bios updates
CN109388216B (en) Starting device, single board of network equipment and network equipment
TWI764648B (en) Mainboard, external device of mainboard, and booting method of mainboard
CN112307697B (en) FPGA logic reload circuit
CN105446903A (en) Information processing method and electronic device
CN108388481B (en) Intelligent watchdog circuit system of OLT equipment
CN110908673A (en) Digital power supply chip burning method
CN116048226B (en) FPGA chip reset circuit, method and equipment
CN115081035B (en) Program encryption upgrading circuit and method based on processor and FPGA chip

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant