A Multifunctional Programming and Debugging Interface Circuit and Method for a Single-Chip Microcomputer
By designing a multi-function programming and debugging interface circuit for microcontrollers that integrates online programming and debugging, ISP burning and communication functions, the problem of traditional interfaces occupying many pins and requiring manual intervention is solved, and an efficient and low-cost microcontroller debugging and burning process is achieved.
Patent Information
- Application Number
- CN202210330762.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2042-03-30
AI Technical Summary
In the prior art, the online debugging of a microcontroller requires manual intervention, and the traditional interface occupies a lot of pins, resulting in high chip costs and the integration of online programming and debugging, ISP burning and communication functions cannot be achieved.
A multi-function programming and debugging interface circuit of a microcontroller is designed. Through the combination of online programming and debugging to interface, burn-in interface, OC gate circuit and integrated interface circuit, the integration of online programming and debugging, ISP recording and communication functions is achieved without manual intervention.
It realizes the integration of microcontroller online programming and debugging, ISP burning and communication functions, reduces chip costs, simplifies the debugging process, and improves the efficiency of programming and debugging.
Smart Images

Figure CN114779683B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of debugging interfaces, and more specifically, to a multi-functional programming and debugging interface circuit and method for a single-chip microcomputer. Background Art
[0002] Currently, traditional solutions for debugging and programming a single-chip microcomputer generally use different interfaces, which require a large number of pins of the single-chip microcomputer, resulting in a high cost of the chip. Moreover, during traditional in-circuit debugging of a single-chip microcomputer, manual intervention is required to enable communication between the single-chip microcomputer and the host computer and perform data interaction.
[0003] Therefore, how to provide a multi-functional programming and debugging interface circuit and method that integrates in-circuit programming and debugging, ISP programming, and communication functions is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0004] In view of this, the present invention provides a multi-functional programming and debugging interface circuit and method for a single-chip microcomputer, which can realize in-circuit programming and debugging, ISP programming, and communication functions without manual setting or changing of the wiring method by personnel.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A multi-functional programming and debugging interface circuit for a single-chip microcomputer, which is respectively connected to a host computer and a programmer, includes: an in-circuit programming and debugging adapter, a programming adapter, a first OC gate circuit, a second OC gate circuit, and an integrated interface circuit; the integrated interface circuit includes an integrated interface, a pull-up resistor R3, and a pull-up resistor R4;
[0007] The host computer, the programmer, the in-circuit programming and debugging adapter, and the integrated interface are connected in sequence. The in-circuit programming and debugging adapter is used to obtain a data signal SWDIO, a clock signal SWCLK, and a reset signal RESET from the host computer through the programmer and output them to the integrated interface circuit;
[0008] Both the first OC gate circuit and the second OC gate circuit are respectively connected to the host computer and the programming adapter. The first OC gate circuit is used to receive a ready signal DTR from the host computer and output a reset signal RESET, and the second OC gate circuit is used to receive a request signal RTS from the host computer and output a start signal BOOT0;
[0009] The programming adapter is respectively connected to the host computer, the first OC gate circuit, the second OC gate circuit and the integrated interface circuit. The programming adapter is used to receive the reset signal RESET, the start signal BOOT0 and the communication signal of the host computer and output them to the integrated interface circuit. The pull-up resistor R3 is connected to the reset signal RESET pin of the integrated interface, and the pull-up resistor R4 is connected to the BOOT0 pin of the integrated interface.
[0010] Preferably, the multi-functional programming and debugging interface circuit of the single-chip microcomputer further includes a level conversion circuit. One end of the level conversion circuit is bidirectionally connected to the host computer, and the other end is connected to the programming adapter. The level conversion circuit receives the communication signal of the host computer and outputs a TTL level signal to the programming adapter.
[0011] Preferably, the multi-functional programming and debugging interface circuit of the single-chip microcomputer further includes a host computer serial port connector. One end of the host computer serial port connector is bidirectionally connected to the host computer, and the other end is respectively connected to the level conversion circuit, the first OC gate circuit and the second OC gate circuit. The host computer serial port connector receives the communication signal of the host computer and sends it to the level conversion circuit, and at the same time sends the ready signal DTR and the request signal RTS to the first OC gate circuit and the second OC gate circuit.
[0012] Preferably, the in-circuit programming and debugging adapter includes an SWD adapter, and the programming adapter includes an ISP adapter.
[0013] Preferably, the level conversion circuit includes a MAX232 chip.
[0014] Preferably, the host computer serial port connector includes a DB9 plug.
[0015] A multi-functional programming and debugging method for a single-chip microcomputer, the specific content includes:
[0016] (1) In-circuit programming and debugging stage: The first OC gate circuit receives the low-level ready signal DTR of the host computer, and at the same time the second OC gate circuit receives the low-level request signal RTS of the host computer. The first OC gate circuit and the second OC gate circuit are not conducting. The pull-up resistor R3 and the pull-up resistor R4 control the reset signal RESET and the start signal BOOT0 of the integrated interface to be high level. The integrated interface obtains the data signal SWDIO, the clock signal SWCLK and the reset signal RESET required for programming from the host computer through the in-circuit programming and debugging adapter for in-circuit programming and debugging. At the same time, it receives the communication signal of the programming adapter through the integrated interface to communicate with the host computer, realizing in-circuit debugging in the in-circuit programming stage;
[0017] (2) Programming stage: The first OC gate circuit receives the high-level ready signal DTR from the host computer and outputs a low-level reset signal RESET. At the same time, the second OC gate circuit receives the high-level request signal RTS from the host computer and outputs a low-level start signal BOOT0. The programming adapter receives the reset signal RESET and the start signal BOOT0 and transmits them. The single-chip microcomputer captures the low-level start signal BOOT0 instantaneously during reset and enters the BootLoader mode for programming. After the programming is completed, the ready signal DTR and the request signal RST are converted to low level. The pull-up resistor R3 and the pull-up resistor R4 control the reset signal RESET and the start signal BOOT0 to be at high level, and the single-chip microcomputer automatically executes the program after programming;
[0018] (3) On-line debugging and communication stage: The host computer cancels the ready signal DTR and the request signal RST. The first OC gate circuit and the second OC gate circuit are not conducting. The start signal BOOT0 of the integrated interface maintains a high-level state. The reset signal RESET of the integrated interface is only controlled by the programmer, and debugging and communication are carried out through the programming adapter of the integrated interface.
[0019] Preferably, in a method for multi-functional programming and debugging of a single-chip microcomputer, it further includes that a level conversion circuit receives the communication signal from the host computer and outputs a TTL level signal to the programming adapter.
[0020] Preferably, in a method for multi-functional programming and debugging of a single-chip microcomputer, it further includes that the serial port connector of the host computer receives the communication signal from the host computer and transmits it to the level conversion circuit, and at the same time transmits the ready signal DTR and the request signal RTS to the first OC gate circuit and the second OC gate circuit.
[0021] Through the above technical solutions, compared with the prior art, the present invention discloses a multi-functional programming and debugging interface circuit and method for a single-chip microcomputer. By integrating programming, communication and on-line programming and debugging technologies, the single-chip microcomputer has functions of on-line programming and debugging, programming and communication. When the single-chip microcomputer is on-line debugged, it can quickly realize communication between the single-chip microcomputer and the host computer and perform data interaction without manual intervention. Moreover, the programming and debugging interface is simple, the circuit board occupies less area, and the IO resources of the single-chip microcomputer are less occupied, which is suitable for occasions such as programming and debugging by developers and mass program downloading by subsequent production personnel. Description of the Drawings
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.
[0023] Figure 1 The attached drawing is a schematic diagram of the multi-functional programming and debugging interface circuit provided by the present invention;
[0024] Figure 2 The attached drawing is the specific connection diagram of the multi-functional programming and debugging interface circuit provided by the present invention. Specific embodiments
[0025] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0026] The embodiment of the present invention discloses a multi-functional programming and debugging interface circuit for a single-chip microcomputer, which is respectively connected to a host computer and a programmer, and includes: an in-circuit programming and debugging adapter, a programming adapter, a first OC gate circuit, a second OC gate circuit, and an integrated interface circuit; the integrated interface circuit includes an integrated interface, a pull-up resistor R3, and a pull-up resistor R4;
[0027] The host computer, the programmer, the in-circuit programming and debugging adapter, and the integrated interface are connected in sequence. The in-circuit programming and debugging adapter is used to obtain the data signal SWDIO, the clock signal SWCLK, and the reset signal RESET from the host computer through the programmer and output them to the integrated interface circuit;
[0028] Both the first OC gate circuit and the second OC gate circuit are respectively connected to the host computer and the programming adapter. The first OC gate circuit is used to receive the ready signal DTR of the host computer and output the reset signal RESET. The second OC gate circuit is used to receive the request signal RTS of the host computer and output the start signal BOOT0;
[0029] The programming adapter is respectively connected to the host computer, the first OC gate circuit, the second OC gate circuit, and the integrated interface circuit. The programming adapter is used to receive the reset signal RESET, the start signal BOOT0, and the communication signal of the host computer and output them to the integrated interface circuit. The pull-up resistor R3 is connected to the reset signal RESET pin of the integrated interface, and the pull-up resistor R4 is connected to the BOOT0 pin of the integrated interface.
[0030] To further implement the above technical solution, a multi-functional programming and debugging interface circuit for a single-chip microcomputer further includes a level conversion circuit. One end of the level conversion circuit is bidirectionally connected to the host computer, and the other end is connected to a programming transfer interface. The level conversion circuit receives the communication signal from the host computer and outputs a TTL level signal to the programming transfer interface.
[0031] To further implement the above technical solution, a multi-functional programming and debugging interface circuit for a single-chip microcomputer further includes a host computer serial port connector. One end of the host computer serial port connector is bidirectionally connected to the host computer, and the other end is respectively connected to the level conversion circuit, the first OC gate circuit, and the second OC gate circuit. The host computer serial port connector receives the host computer communication signal and sends it to the level conversion circuit, and at the same time sends the ready signal DTR and the request signal RTS to the first OC gate circuit and the second OC gate circuit.
[0032] To further implement the above technical solution, the in-circuit programming and debugging transfer interface includes an SWD transfer interface, and the programming transfer interface includes an ISP transfer interface.
[0033] To further implement the above technical solution, the level conversion circuit includes a MAX232 chip.
[0034] To further implement the above technical solution, the host computer serial port connector includes a DB9 plug.
[0035] In this embodiment, as Figure 2 , the data signal SWDIO pin and the clock signal SWCLK pin of the SWD transfer interface X1 are respectively connected to the data signal SWDIO pin and the clock signal SWCLK pin of the integrated interface circuit, and the reset signal RESET pin is respectively connected to the reset signal RESET pins of X4, the first OC gate circuit, and the ISP programming transfer interface.
[0036] The RXD pin of the host computer serial port connector DB9 is connected to the T2OUT pin of the level conversion circuit, the TXD pin is connected to the R2IN pin of the level conversion circuit, the ready signal DTR pin is connected to the first OC gate circuit, and the request signal RTS pin is connected to the second OC gate circuit.
[0037] In this embodiment, the level conversion circuit includes a level driving chip D1, a first capacitor, a second capacitor, a third capacitor, and a fourth capacitor;
[0038] The C1+ pin of the level driving chip D1 is connected to one end of the third capacitor, the C1- pin is connected to the other end of the third capacitor, the Vs+ pin is connected to one end of the fourth capacitor, the other end of the fourth capacitor is connected to the power supply VCC, the C2+ pin is connected to one end of the second capacitor, the C2- pin is connected to the other end of the second capacitor, the Vs- pin is connected to one end of the first capacitor, the other end of the first capacitor is grounded, the T2OUT pin is connected to the RXD pin of the host computer serial port connector, the R2IN pin is connected to the TXD pin of the host computer serial port connector, and the R2OUT pin and the T2IN pin are respectively connected to the programming adapter and the integrated interface circuit.
[0039] In this embodiment, the input of the level conversion circuit is the RS232 serial port TXD and RXD signals of the host computer, the output is the USART0_TX and USART0-RX signals corresponding to the TTL level, and the TTL level signal is led out to the programming adapter.
[0040] In this embodiment, the first OC gate circuit includes a first triode V1 and a first resistor R1, and the second OC gate circuit includes a second triode V2 and a second resistor R2;
[0041] One end of R1 is connected to the DTR pin of the ready signal of the host computer serial port connector DB9, the other end is connected to the base of V1, the collector of V1 is respectively connected to the reset signal RESET pin of the ISP programming adapter, the integrated interface circuit and the in-circuit multi-functional programming and debugging interface SWD, one end of R2 is connected to the RTS pin of the request signal of the host computer serial port connector DB9, the other end is connected to the base of V2, and the collector of V2 is respectively connected to the ISP programming adapter and the integrated interface circuit.
[0042] In this embodiment, the input signal of the first OC gate circuit is the ready signal DTR, the output signal is the reset signal RESET, and this signal is led out to the programming adapter; the input signal of the second OC gate circuit is the request signal RST, the output signal is BOOT0, and this signal is led out to the programming adapter.
[0043] The reset signal RESET pin of the ISP programming adapter is respectively connected to the collector of V1 and the integrated interface circuit, the TXD pin is respectively connected to the R2OUT pin of the level driving chip D1 and the integrated interface circuit, the RXD pin is respectively connected to the T2IN pin of the level driving chip D1 and the integrated interface circuit, and the BOOT0 pin is respectively connected to the collector of V2 and the integrated interface circuit.
[0044] In this embodiment, the integrated interface circuit includes an integrated interface X4, a third resistor R3 and a fourth resistor R4;
[0045] The data signal SWDIO pin and the clock signal SWCLK pin of X4 are respectively connected to the data signal SWDIO pin and the clock signal SWCLK pin of the SWD online multi-function programming and debugging interface, the reset signal RESET pin of X4 is respectively connected to the reset signal RESET pin of the SWD online programming and debugging adapter interface, the reset signal RESET pin of the ISP burning adapter interface, the collector of V1 and one end of the third resistor R3, the BOOT0 pin of X4 is respectively connected to the BOOT0 pin of the ISP burning adapter interface, the collector of V2 and one end of the fourth resistor R4, the RXD pin of X4 is respectively connected to the R2OUT pin of the level driving chip and the RXD pin of the ISP burning adapter interface, the TXD pin of X4 is respectively connected to the T2IN pin of the level driving chip and the TXD pin of the burning adapter interface, and the other ends of the third resistor R3 and the fourth resistor R4 are both connected to the power supply VCC.
[0046] In this embodiment, the SWD adapter is a 20-pin pin, which is connected to the programming tool through the cable provided by the programming tool. The programming tool includes ST-LINK, ULINK, etc.
[0047] In this embodiment, the ISP adapter is a 10-pin plug, and except for necessary signals, the remaining pins are left floating.
[0048] In this embodiment, the SWD adapter and the ISP adapter can be used separately or simultaneously.
[0049] A multifunctional programming and debugging method for a single-chip microcomputer, the specific contents of which include:
[0050] (1) Online programming and debugging stage: The first OC gate circuit receives the low-level preparation signal DTR from the host computer, and the second OC gate circuit receives the low-level request signal RTS from the host computer. The first OC gate circuit and the second OC gate circuit are not conducting. The pull-up resistors R3 and R4 control the reset signal RESET and the start signal BOOT0 of the integrated interface to be high level. The integrated interface obtains the data signal SWDIO, clock signal SWCLK and reset signal RESET required for programming from the host computer through the online programming and debugging interface to perform online programming and debugging. At the same time, the integrated interface receives the communication signal of the burning interface through the integrated interface to communicate with the host computer, thereby realizing the debugging function in the online programming stage;
[0051] (2) Burning stage: The first OC gate circuit receives the high-level preparation signal DTR of the host computer and outputs a low-level reset signal RESET. At the same time, the second OC gate circuit receives the high-level request signal RTS of the host computer and outputs a low-level start signal BOOT0. The burning interface receives the reset signal RESET and the start signal BOOT0 and sends them. The single-chip microcomputer captures the low-level start signal BOOT0 at the reset moment and enters the BootLoader mode for burning. After the burning is completed, the preparation signal DTR and the request signal RST are converted to low levels, and the pull-up resistors R3 and R4 control the reset signal RESET and the start signal BOOT0 to be high levels. The single-chip microcomputer automatically executes the burned program;
[0052] (3) During the online debugging and communication stage, the host computer cancels the preparation signal DTR and the request signal RST, the first OC gate circuit and the second OC gate circuit are not conducting, the startup signal BOOT0 of the integrated interface maintains a high level state, and the reset signal RESET of the integrated interface is only controlled by the programmer. Debugging and communication are performed through the burning adapter of the integrated interface.
[0053] In practical applications, a multifunctional programming and debugging method for a single-chip microcomputer also includes: a burning stage is performed after the online programming and debugging stage is completed, and an online debugging and communication stage is performed after the burning stage is completed; the online programming and debugging stage, the burning stage, and the online debugging and communication stage are performed simultaneously; according to usage requirements, the online programming and debugging stage, the burning stage, and the online debugging and communication stage can be performed independently.
[0054] In order to further implement the above technical solution, a multifunctional programming and debugging method for a single-chip microcomputer also includes a level conversion circuit that receives a communication signal from a host computer and outputs a TTL level signal to a burning adapter.
[0055] In order to further implement the above technical solution, a multifunctional programming and debugging method for a single-chip microcomputer also includes a host computer serial port connector receiving a host computer communication signal and sending it to a level conversion circuit, and simultaneously sending a ready signal DTR and a request signal RTS to a first OC gate circuit and a second OC gate circuit.
[0056] In this embodiment, combined with Figure 2 The principle of the present invention is explained as follows: the ST-LINK programmer and its own cable are used to connect to the host computer and the SWD adapter interface X1 respectively. X1 leads out the data signal SWDIO, clock signal SWCLK and microcontroller reset signal RESET required for SWD programming. The signal is connected to the SWD interface and reset pin of the microcontroller through X4, so that the SWD online programming and debugging function can be realized.
[0057] The upper computer serial port connector DB9 is connected to the upper computer, leading out the RS232 communication signal, obtaining the upper computer communication signal and respectively transmitting it to the level conversion circuit, the first OC gate circuit and the second OC gate circuit. The MAX232 level conversion circuit converts the level of the communication signal to the TTL level and connects it to the serial port of the single-chip microcomputer; at the same time, the two OC gate circuits respectively convert the control signal ready signal DTR and the request signal RST in the communication signal into the reset signal RESET and the start signal BOOT0;
[0058] When ISP programming is not required, the ISP programming software controls the ready signal DTR and the request signal RST to be at a low level, and the first OC gate circuit and the second OC gate circuit are not conducting. Since the reset signal RESET and the start signal BOOT0 of X4 have built-in pull-up resistors, at this time, the reset signal RESET and BOOT0 are at a high level. When using ISP to program the program, only need to operate the ISP programming software on the upper computer. The ISP programming software can automatically control the ready signal DTR and the request signal RST to output a high level. At this time, the first OC gate circuit and the second OC gate circuit are conducting, and the reset signal RESET and the BOOT0 control signal of X4 are in a low level state, so that when the single-chip microcomputer is reset instantaneously, it captures that the BOOT0 pin is at a low level, and the single-chip microcomputer enters the Bootloader mode. At this time, the ISP programming function can be completed.
[0059] After the programming is completed, the ISP software automatically controls the ready signal DTR and the request signal RST to be at a low level. At this time, both OC gate circuits are not conducting. The reset pin reset signal RESET and the BOOT0 pin of the single-chip microcomputer, due to the built-in pull-up resistors, return to the high level state again, and the single-chip microcomputer will automatically execute the program after programming; at this time, close the upper computer programming software and open the upper computer serial port debugging tool, and the serial port communication with the single-chip microcomputer can be established by using the serial port debugging tool.
[0060] In this embodiment, open the upper computer programming and debugging software and the serial port debugging tool at the same time, cancel the options of the ready signal DTR and the request signal RST on the serial port debugging tool. The ready signal DTR and the request signal RST are in the default low level state. The first OC gate and the second OC gate are not conducting. The reset signal RESET of the single-chip microcomputer is only controlled by the external ST-LINK programmer, and the BOOT0 is always at a high level state. The single-chip microcomputer is in the state of program programmable and debugging. During debugging, the serial port communication function can be realized through the DB9 plug of the upper computer, and the serial port can print out relevant data in real time to realize the fast communication function during debugging.
[0061] In the present specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0062] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.
Claims
1. A multi-functional programming and debugging interface circuit for a single-chip microcomputer, which is respectively connected to a host computer and a programmer, characterized in that, it includes: an in-circuit programming and debugging adapter, a programming adapter, a first OC gate circuit, a second OC gate circuit and an integrated interface circuit; the integrated interface circuit includes an integrated interface, a pull-up resistor R3 and a pull-up resistor R4; the host computer, the programmer, the in-circuit programming and debugging adapter and the integrated interface are connected in sequence. The in-circuit programming and debugging adapter is used to obtain data signal SWDIO, clock signal SWCLK and reset signal RESET from the host computer through the programmer and output them to the integrated interface circuit; both the first OC gate circuit and the second OC gate circuit are respectively connected to a serial port connector and the programming adapter. The first OC gate circuit is used to receive the ready signal DTR of the host computer and output the reset signal RESET. The second OC gate circuit is used to receive the request signal RTS of the host computer and output the start signal BOOT0; the programming adapter is respectively connected to the host computer, the first OC gate circuit, the second OC gate circuit and the integrated interface circuit. The programming adapter is used to receive the reset signal RESET, the start signal BOOT0 and the communication signal of the host computer and output them to the integrated interface circuit. The pull-up resistor R3 is connected to the reset signal RESET pin of the integrated interface, and the pull-up resistor R4 is connected to the BOOT0 pin of the integrated interface.
2. The multi-functional programming and debugging interface circuit for a single-chip microcomputer according to claim 1, characterized in that, it further includes a level conversion circuit, and the level conversion circuit is bidirectionally connected to the host computer and the programming adapter respectively. The level conversion circuit is used to receive the communication signal of the host computer and output a TTL level signal to the programming adapter.
3. The multi-functional programming and debugging interface circuit for a single-chip microcomputer according to claim 2, characterized in that, it further includes a host computer serial port connector, and the host computer serial port connector is respectively connected to the host computer, the level conversion circuit, the first OC gate circuit and the second OC gate circuit. The host computer serial port connector is used to receive the communication signal of the host computer and send it to the level conversion circuit, and at the same time send the ready signal DTR and the request signal RTS to the first OC gate circuit and the second OC gate circuit.
4. The multi-functional programming and debugging interface circuit for a single-chip microcomputer according to claim 1, characterized in that, the in-circuit programming and debugging adapter includes an SWD adapter, and the programming adapter includes an ISP adapter.
5. The multi-functional programming and debugging interface circuit for a single-chip microcomputer according to claim 2, characterized in that, the level conversion circuit includes a MAX232 chip.
6. The multi-functional programming and debugging interface circuit for a single-chip microcomputer according to claim 3, characterized in that, the host computer serial port connector includes a DB9 plug.
7. A multi-functional programming and debugging method for a single-chip microcomputer, based on the multi-functional programming and debugging interface circuit for a single-chip microcomputer described in any one of claims 1-6, characterized in that, the specific content includes: (1) Online programming and debugging stage: The first OC gate circuit receives the low-level ready signal DTR from the host computer, and at the same time, the second OC gate circuit receives the low-level request signal RTS from the host computer. The first OC gate circuit and the second OC gate circuit are not turned on. The pull-up resistor R3 and the pull-up resistor R4 control the reset signal RESET and the start signal BOOT0 of the integrated interface to be at a high level. The integrated interface obtains the data signal SWDIO, the clock signal SWCLK, and the reset signal RESET required for programming from the host computer through the online programming and debugging adapter for online programming. At the same time, it receives the communication signal of the programming adapter through the integrated interface and communicates with the host computer to realize online debugging in the online programming stage; (2) Programming stage: The first OC gate circuit receives the high-level ready signal DTR from the host computer and outputs a low-level reset signal RESET. At the same time, the second OC gate circuit receives the high-level request signal RTS from the host computer and outputs a low-level start signal BOOT0. The programming adapter receives the reset signal RESET and the start signal BOOT0 and sends them. The single-chip microcomputer captures the low-level start signal BOOT0 instantaneously when reset and enters the BootLoader mode for programming. After the programming is completed, the ready signal DTR and the request signal RST are converted to a low level. The pull-up resistor R3 and the pull-up resistor R4 control the reset signal RESET and the start signal BOOT0 to be at a high level, and the single-chip microcomputer automatically executes the program after programming; (3) Online debugging and communication stage: The host computer cancels the ready signal DTR and the request signal RST. The first OC gate circuit and the second OC gate circuit are not turned on. The start signal BOOT0 of the integrated interface maintains a high-level state. The reset signal RESET of the integrated interface is only controlled by the programmer, and debugging and communication are carried out through the programming adapter of the integrated interface.
8. The multi-functional programming and debugging method for a single-chip microcomputer according to claim 7, characterized in that, it further includes a level conversion circuit that receives the communication signal from the host computer and outputs a TTL level signal to the programming adapter.
9. The multi-functional programming and debugging method for a single-chip microcomputer according to claim 8, characterized in that, it further includes that the host computer serial port connector receives the communication signal from the host computer and sends it to the level conversion circuit, and at the same time sends the ready signal DTR and the request signal RTS to the first OC gate circuit and the second OC gate circuit.
Citation Information
Patent Citations
Single-chip microcomputer and debugging method and burning method thereof
CN110119373A
Signal conversion device, system and method for on-line programming of single-chip microcomputer
CN113377036A