Circuit topology for automatically feeding dogs in MCU programming process
By introducing the circuit topology of automatic dog feeding during MCU burning, combining watchdog chip and reset chip, the OR gate circuit is used to realize automatic dog feeding, which solves the problem of low human operation efficiency during MCU burning, and improves the burning Recording efficiency and reduces the risk of errors.
Patent Information
- Application Number
- CN202411049032.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-15
AI Technical Summary
During the burning process of existing MCU programs, human intervention is required to switch the watchdog circuit to avoid the program running, resulting in inefficiency and error-prone problems.
A circuit topology for automatic feeding of dogs is designed, including MCU, watchdog chip, reset chip and feeding dog signal OR gate circuit. The feeding of dog signal OR gate circuit is connected through the GPIO pin to automatically feed the dog when the program is burned. The normal state will be automatically restored to the end after the burn is completed.
Implements the automation of MCU program burning, saves preparation and recovery time, avoids errors and damage caused by human operations, and improves the burning efficiency. The circuit is clear, low-cost, easy to implement, and does not occupy additional chip interfaces. resource.
Smart Images

Figure CN118963784A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of electronic products, and more specifically, particularly relates to a circuit topology for automatically feeding a dog during a MCU programming process. Background Art
[0002] In the manufacturing process of electronic products, we often use single-chip microcomputers or ARM controllers. These control chips do not have any programs in the initial state. In order to make the single-chip microcomputer or ARM chip perform operations according to the functions we designed, we need to burn the pre-written program files into the controller chip. This process of solidifying the program code into non-volatile memory is called program burning. In the development and production of single-chip microcomputer products, using the SWD / JTAG interface for in-circuit programming is a very widely used method.
[0003] Before protocols like SWD and JTAG came along, debuggers and their protocols were a mess, and each MCU manufacturer came up with its own proprietary method to load code onto their MCU. Every time a manufacturer released an MCU, embedded software engineers needed to understand their proprietary protocol to load code into the microcontroller, which was time-consuming, laborious, and inefficient.
[0004] JTAG is a standard developed by the IEEE standards organization, numbered IEEE1149.1. It can be used for burning programs, online debugging, and port scanning. To achieve the above tasks, the JTAG interface usually contains five signals: TCK, TMS, TDI, TDO, and TRST.
[0005] SWD (Serial Wire Debug) is a protocol designed by ARM for programming and debugging ARM architecture microcontrollers. The SWD interface usually contains two signals: SWCLK and SWDIO.
[0006] Both JTAG and SWD interfaces can be used to download programs, and each has its own advantages. Many MCUs on the market support both SWD / JTAG download methods, and the pins of the two are multiplexed. For example, SWCLK and TCK are both clock signals of the SWD / JTAG interface, and the two are usually the same pin in hardware. The SWD / JTAG interface is a serial interface, that is, each clock beat corresponds to a bit of data transmission.
[0007] Strong interference (EMI, radiation, etc.) and out-of-range power supply, input signal, etc. may cause the product program to enter an unpredictable state, which is usually called "program runaway". This failure will cause the product to fail and cannot recover by itself. In product circuit design, a watchdog circuit is usually designed to handle this situation. When the program runs normally and the dog is fed within the specified time (dog feeding cycle), the watchdog circuit does not work. When the program runs away for some reason and the dog cannot be fed in time, the watchdog circuit will reset the MCU, return the program to the initial position, and start running from the beginning.
[0008] However, during the program burning process, the MCU code has not yet been executed and cannot actively feed the dog. If the burning time exceeds the feeding cycle, the MCU will be forced to reset, which will cause the burning to fail.
[0009] Among the three existing designs,
[0010] Designed jump resistor
[0011] When designing the circuit, a low resistance (usually 0) resistor is connected in series between the watchdog output signal and the reset trigger signal. When programming, the resistor is not soldered; after programming is completed, the resistor is re-soldered.
[0012] Shorting jumper cap
[0013] When designing the circuit, insert a jumper pin in series between the watchdog output signal and the reset trigger signal. When burning the program, remove the jumper cap; after the program is burned, insert the jumper cap.
[0014] Dip switch
[0015] When designing the circuit, a dip switch is inserted in series between the watchdog output signal and the reset trigger signal. When the program is burned, the dip switch is turned to the OFF position; after the program is burned, the dip switch is turned to the ON position.
[0016] These switching solutions have their own advantages, but they all have a common drawback: when switching modes, human intervention is required, such as manual welding, manual plugging and unplugging, or manual dialing. The existing implementation solutions have inherent drawbacks such as low switching efficiency and easy errors, which are not conducive to large-scale production and debugging of products.
[0017] Therefore, a circuit topology is designed to realize automatic dog feeding during program burning without additional manual operation; after burning is completed, the control of the dog feeding signal is automatically returned without affecting the normal function of the product. Summary of the invention
[0018] The purpose of the present invention is to solve the shortcomings existing in the prior art, realize automatic dog feeding during MCU program burning, avoid the destruction of the program burning process by the watchdog circuit, thereby achieving the state that the watchdog circuit can automatically adapt to the two states of program burning and normal operation without artificially handling the board card. The circuit is introduced into the board card design, which can save the preparation time before the board card program burning and the time of restoring the normal state after burning, and at the same time avoid the mistakes, damage and forgetfulness caused by human operation, and can greatly improve the burning efficiency.
[0019] To achieve the above object, the present invention provides the following technical solutions:
[0020] A circuit topology for automatically feeding a watchdog during the MCU programming process includes an MCU, a watchdog chip, a reset chip, and a watchdog signal OR gate circuit.
[0021] The GPIO pin at the center of one end of the MCU is communicatively connected to a dog feeding signal OR gate circuit, and a burning interface is provided below the MCU, one end of the burning interface is communicatively connected to the dog feeding signal OR gate circuit through a wire, one end of the dog feeding signal OR gate circuit is electrically connected to a watchdog chip, one end of the watchdog chip is electrically connected to a reset chip, and one end of the reset chip is electrically connected to a reset interface RST provided above the MCU;
[0022] MCU refers to microcontroller unit, also known as single-chip microcomputer, which appropriately reduces the frequency and specifications of the central processing unit, and integrates memory, counter, USB, A / D conversion, UART, PLC and DMA peripheral interfaces, and even LCD driver circuits on a single chip to form a chip-level computer, which can perform different combination controls for different application scenarios;
[0023] A watchdog chip is a hardware timer used to monitor a microcontroller. Its main function is to ensure that the system can automatically reset when a software failure occurs, thereby resuming normal operation. The watchdog chip works by regularly receiving a dog-feeding signal. If the MCU fails to send a dog-feeding signal in time, the watchdog chip will consider that there is a problem with the system and trigger a reset operation.
[0024] A reset chip is a specially designed integrated circuit used to generate and monitor reset signals in electronic devices; the reset signal is a key signal to ensure that the system can be properly initialized at startup; the reset chip provides multiple functions, including power supply monitoring, manual reset input, and watchdog timer monitoring;
[0025] Feeding dog signal OR gate circuit, feeding dog signal is a signal in the watchdog timer system, which is used to reset the watchdog timer. The watchdog timer is a hardware timer used to monitor the status of the microcontroller; if the MCU fails to send feeding dog signal regularly, the watchdog timer will think that there is a problem with the system and trigger a reset operation to ensure that the system returns to normal operation; and the OR gate circuit is a basic logic gate circuit, which has two inputs and one output; the output of the OR gate is high level if and only if at least one input is high level, if all inputs are low level, the output is also low level; therefore, the feeding dog signal and the OR gate circuit are used in combination.
[0026] Preferably, the watchdog signal OR gate circuit includes a Q1 transistor, an R5 resistor, an R6 resistor and an R7 resistor, the Q1 transistor also includes a base, a collector junction and an emitter junction, one end of the base is electrically connected to the R6 resistor, one end of the R6 resistor is electrically connected to the R7 resistor below, one end of the R7 resistor is electrically connected to the emitter junction, and one end of the collector junction is electrically connected to the R5 resistor.
[0027] Preferably, the watchdog chip and the reset chip are combined into one to form a UM706SS chip, and the UM706SS chip refers to a power monitoring and reset chip, a WDI pin is provided on one side of the UM706SS chip, a RESET pin is provided above the WDI pin, a WDO pin is provided above the RESET pin, a PFO pin is provided below the WDI pin, one end of the WDI pin is electrically connected to an R5 resistor via a WDI wire, and a WDO pin on the UM706SS chip is electrically connected to an R3 resistor via a WDO wire, and one end of the R3 resistor is electrically connected to an R5 resistor via a WDI wire. It is electrically connected to an MR pin provided on the UM706SS, a VCC pin connected to a power supply is provided below the MR pin, a GND pin is provided below the VCC pin, a PFI pin is provided below the GND pin, one end of the VCC pin is connected to a first VCC power supply voltage, the bottom of the first VCC power supply voltage is electrically connected to a C1 capacitor through a wire, one side below the C1 capacitor is respectively connected to the GND and PFI pins provided on the UM706SS chip through wires, an extended end of the bottom of the C1 capacitor is grounded through a ground wire, and a RESET pin is provided below the WOD pin.
[0028] Preferably, one end of the R6 resistor is electrically connected to a burning interface, the burning interface includes a diode inside, the D1 end at the top of the diode is connected to the D2 end through a wire, the bottom of the D2 end is grounded through a ground wire, and four groups of interfaces are provided on the diode, one group of which is connected to the R6 resistor through a wire.
[0029] Preferably, the RESET pin is electrically connected to a resistor R4 via a wire, and one end of the resistor R4 is electrically connected to a RST interface provided on the MCU via a wire.
[0030] Preferably, the extended end of the WDI wire is connected to an R1 resistor via a wire, and one end of the R1 resistor is connected to a second VCC power supply voltage via a wire.
[0031] Preferably, one end of the second VCC power supply voltage is electrically connected to a resistor R2 via a wire.
[0032] Preferably, one end of the R2 resistor is connected in series with the R4 resistor and the RST connecting line through a wire, and the extended end is electrically connected to the C2 capacitor, and the C2 capacitor is grounded through a grounding wire.
[0033] Technical effects and advantages of the present invention:
[0034] The circuit topology of the present invention realizes automatic dog feeding during MCU program burning, avoids the watchdog circuit from destroying the program burning process, and thus achieves the state that the watchdog circuit can automatically adapt to the two states of program burning and normal operation without manual processing of the board. The circuit is introduced into the board design, which can save the preparation time before the board program burning and the time to restore to the normal state after burning, and at the same time avoids mistakes, damage and forgetfulness caused by human operation, which can greatly improve the burning efficiency.
[0035] In addition, the circuit has clear principles, conventional devices, low cost, and is easy to implement. It does not occupy additional interface resources of the chip and has strong universality. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a topological principle block diagram of the automatic dog feeding circuit of the present invention;
[0037] Figure 2 It is a circuit diagram of the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0039] See also Figure 1-2 The present invention provides a circuit topology for automatically feeding a watchdog in the process of burning an MCU, including an MCU, a watchdog chip, a reset chip and a watchdog signal OR gate circuit.
[0040] The GPIO pin at the center of one end of the MCU is connected to a dog feeding signal OR gate circuit, and a burning interface is provided below the MCU, one end of the burning interface is connected to a dog feeding signal OR gate circuit through a wire, one end of the dog feeding signal OR gate circuit is electrically connected to a watchdog chip, one end of the watchdog chip is electrically connected to a reset chip, and one end of the reset chip is electrically connected to a reset interface RST provided above the MCU;
[0041] MCU refers to microcontroller unit, also known as single-chip microcomputer, which appropriately reduces the frequency and specifications of the central processing unit, and integrates memory, counter, USB, A / D conversion, UART, PLC and DMA peripheral interfaces, and even LCD driver circuits on a single chip to form a chip-level computer, which can perform different combination controls for different application scenarios;
[0042] A watchdog chip is a hardware timer used to monitor a microcontroller. Its main function is to ensure that the system can automatically reset when a software failure occurs, thereby resuming normal operation. The watchdog chip works by regularly receiving a dog-feeding signal. If the MCU fails to send a dog-feeding signal in time, the watchdog chip will consider that there is a problem with the system and trigger a reset operation.
[0043] A reset chip is a specially designed integrated circuit used to generate and monitor reset signals in electronic devices; the reset signal is a key signal to ensure that the system can be properly initialized at startup; the reset chip provides multiple functions, including power supply monitoring, manual reset input, and watchdog timer monitoring;
[0044] Feeding dog signal OR gate circuit, feeding dog signal is a signal in the watchdog timer system, which is used to reset the watchdog timer. The watchdog timer is a hardware timer used to monitor the status of the microcontroller; if the MCU fails to send feeding dog signal regularly, the watchdog timer will think that there is a problem with the system and trigger a reset operation to ensure that the system returns to normal operation; and the OR gate circuit is a basic logic gate circuit, which has two inputs and one output; the output of the OR gate is high level if and only if at least one input is high level, if all inputs are low level, the output is also low level; therefore, the feeding dog signal and the OR gate circuit are used in combination.
[0045] According to the attached Figure 2 The circuit diagram in:
[0046] The watchdog signal OR gate circuit includes a Q1 transistor, an R5 resistor, an R6 resistor and an R7 resistor. The Q1 transistor also includes a base, a collector junction and an emitter junction. One end of the base is electrically connected to the R6 resistor, one end of the R6 resistor is electrically connected to the R7 resistor below, one end of the R7 resistor is electrically connected to the emitter junction, and one end of the collector junction is electrically connected to the R5 resistor.
[0047] The watchdog chip and the reset chip are combined into a UM706SS chip, and the UM706SS chip refers to a power monitoring and reset chip. A WDI pin is provided on one side of the UM706SS chip, a RESET pin is provided above the WDI pin, a WDO pin is provided above the RESET pin, a PFO pin is provided below the WDI pin, one end of the WDI pin is electrically connected to an R5 resistor through a WDI wire, and the WDO pin on the UM706SS chip is electrically connected to an R3 resistor through a WDO wire, one end of the R3 resistor is electrically connected to an MR pin provided on the UM706SS through a wire, and below the MR pin A VCC pin connected to the power supply is provided, a GND pin is provided below the VCC pin, a PFI pin is provided below the GND pin, one end of the VCC pin is connected to a first VCC power supply voltage, the bottom of the first VCC power supply voltage is electrically connected to a C1 capacitor through a wire, one side below the C1 capacitor is respectively connected to the GND and PFI pins set on the UM706SS chip through wires, an extended end at the bottom of the C1 capacitor is grounded through a ground wire, a RESET pin is provided below the WOD pin, the RESET pin is electrically connected to an R4 resistor through a wire, and one end of the R4 resistor is electrically connected to an RST interface set on the MCU through a wire.
[0048] One end of the R6 resistor is electrically connected to a burning interface, and the burning interface includes a diode inside. The D1 end at the top of the diode is connected to the D2 end through a wire, and the bottom of the D2 end is grounded through a ground wire. Four groups of interfaces are set on the diode, and one group of interfaces is connected to the R6 resistor through a wire.
[0049] The extended end of the WDI wire is connected to the R1 resistor through the wire, one end of the R1 resistor is connected to the second VCC power supply voltage through the wire, one end of the second VCC power supply voltage is electrically connected to the R2 resistor through the wire, one end of the R2 resistor is connected in series with the R4 resistor and the RST connecting line through the wire, and the extended end is electrically connected to the C2 capacitor, and the C2 capacitor is grounded through the ground wire.
[0050] When the MCU is not yet programmed, the MCU_WDG signal from the MCU is in a non-driven state, generally in a floating state or a weak pull-up and pull-down state, and will not interfere with the state of the watchdog's WDI. The state of WDI is completely determined by the state of Q1. During program programming, the programmer drives signals such as SWCLK, and the high and low levels of SWCLK will drive the transistor Q1 to turn on or off. When Q1 is turned on, the WDI signal is pulled down to GND; when Q1 is turned off, the WDI signal will be pulled up to 3.3V due to the pull-up resistor R1. Therefore, the high and low changes of SWCLK will directly cause the WDI to change accordingly, thereby realizing automatic dog feeding.
[0051] After the MCU is burned, SWCLK loses its external driving source. Due to the existence of R7, SWCLK is pulled down to GND, and Q1 is always in the off state. The state of WDI is completely driven by MCU_WDG. When the MCU program is executed normally, periodic high and low level changes will occur, thereby feeding the dog. If the program runs away, WDI stops the high and low level conversion. After reaching the time threshold, the watchdog output signal WDO will trigger the reset circuit, causing the MCU to reset.
[0052] The circuit topology of the present invention realizes automatic dog feeding during MCU program burning, avoids the destruction of the program burning process by the watchdog circuit, and thus achieves the two states of program burning and normal working that can be automatically adapted to by the board card when the watchdog circuit is manually processed. The circuit is introduced into the board card design, which can save the preparation time before the board card program burning and the time to restore to the normal state after burning, and at the same time avoids mistakes, damage and forgetfulness caused by human operation, and can greatly improve the burning efficiency.
[0053] In addition, the circuit has clear principles, conventional devices, low cost, and is easy to implement. It does not occupy additional interface resources of the chip and has strong universality.
[0054] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A circuit topology for automatic dog feeding during MCU programming, including MCU, watchdog chip, reset chip and dog feeding signal OR gate circuit, Features: The GPIO pin at the center of one end of the MCU is communicatively connected to a dog feeding signal OR gate circuit, and a burning interface is provided below the MCU, one end of the burning interface is communicatively connected to the dog feeding signal OR gate circuit through a wire, one end of the dog feeding signal OR gate circuit is electrically connected to a watchdog chip, one end of the watchdog chip is electrically connected to a reset chip, and one end of the reset chip is electrically connected to a reset interface RST provided above the MCU; MCU refers to microcontroller unit, also known as single-chip microcomputer, which appropriately reduces the frequency and specifications of the central processing unit, and integrates memory, counter, USB, A / D conversion, UART, PLC and DMA peripheral interfaces, and even LCD driver circuits on a single chip to form a chip-level computer, which can perform different combination controls for different application scenarios; A watchdog chip is a hardware timer used to monitor a microcontroller. Its main function is to ensure that the system can automatically reset when a software failure occurs, thereby resuming normal operation. The watchdog chip works by regularly receiving a dog-feeding signal. If the MCU fails to send a dog-feeding signal in time, the watchdog chip will consider that there is a problem with the system and trigger a reset operation. A reset chip is a specially designed integrated circuit used to generate and monitor reset signals in electronic devices; the reset signal is a key signal to ensure that the system can be properly initialized at startup; the reset chip provides multiple functions, including power supply monitoring, manual reset input, and watchdog timer monitoring; Feeding dog signal OR gate circuit, feeding dog signal is a signal in the watchdog timer system, which is used to reset the watchdog timer. The watchdog timer is a hardware timer used to monitor the status of the microcontroller; if the MCU fails to send feeding dog signal regularly, the watchdog timer will think that there is a problem with the system and trigger a reset operation to ensure that the system returns to normal operation; and the OR gate circuit is a basic logic gate circuit, which has two inputs and one output; the output of the OR gate is high level if and only if at least one input is high level, if all inputs are low level, the output is also low level; therefore, the feeding dog signal and the OR gate circuit are used in combination.
2. According to claim 1, the circuit topology of automatic dog feeding during the MCU programming process, Features: The watchdog signal OR gate circuit includes a Q1 transistor, an R5 resistor, an R6 resistor and an R7 resistor. The Q1 transistor also includes a base, a collector junction and an emitter junction. One end of the base is electrically connected to the R6 resistor, one end of the R6 resistor is electrically connected to the R7 resistor below, one end of the R7 resistor is electrically connected to the emitter junction, and one end of the collector junction is electrically connected to the R5 resistor.
3. According to the circuit topology of the automatic dog feeding in the MCU burning process described in claim 1, Features: The watchdog chip and the reset chip are combined into one to form a UM706SS chip, and the UM706SS chip refers to a power monitoring and reset chip. A WDI pin is provided on one side of the UM706SS chip, a RESET pin is provided above the WDI pin, a WDO pin is provided above the RESET pin, a PFO pin is provided below the WDI pin, one end of the WDI pin is electrically connected to an R5 resistor via a WDI wire, and a WDO pin on the UM706SS chip is electrically connected to an R3 resistor via a WDO wire, and one end of the R3 resistor is electrically connected to the R5 resistor via a WDI wire. It is connected to the MR pin set on the UM706SS, a VCC pin connected to the power supply is set below the MR pin, a GND pin is set below the VCC pin, a PFI pin is set below the GND pin, one end of the VCC pin is connected to a first VCC power supply voltage, the bottom of the first VCC power supply voltage is electrically connected to a C1 capacitor through a wire, one side below the C1 capacitor is respectively connected to the GND and PFI pins set on the UM706SS chip through wires, an extended end of the bottom of the C1 capacitor is grounded through a ground wire, and a RESET pin is set below the WOD pin.
4. According to claim 2, the circuit topology of automatic dog feeding during the MCU programming process, Features: One end of the R6 resistor is electrically connected to a burning interface, the burning interface includes a diode inside, the D1 end at the top of the diode is connected to the D2 end through a wire, the bottom of the D2 end is grounded through a ground wire, and four groups of interfaces are arranged on the diode, one group of which is connected to the R6 resistor through a wire.
5. According to claim 3, the circuit topology of automatic dog feeding during the MCU programming process, Features: The RESET pin is electrically connected to a resistor R4 through a wire, and one end of the resistor R4 is electrically connected to a RST interface provided on the MCU through a wire.
6. According to claim 3, the circuit topology of automatic dog feeding during the MCU programming process, Features: The extended end of the WDI wire is connected to the R1 resistor via a wire, and one end of the R1 resistor is connected to the second VCC power supply voltage via a wire.
7. The circuit topology of automatic dog feeding during MCU programming according to claim 6, Features: One end of the second VCC power supply voltage is electrically connected to the R2 resistor through a wire.
8. According to claim 7, the circuit topology of automatic dog feeding during MCU programming process, Features: One end of the R2 resistor is connected in series with the R4 resistor and the RST connecting line through a wire, and the extended end is electrically connected to the C2 capacitor, and the C2 capacitor is grounded through a grounding wire.
