MCU reset system and backup power supply therewith
Through the design of the MCU reset system, the judgment module, filter module and reset output module are used to solve the problem that the MCU processor cannot be reset after the program runs away, realize the automatic reset and fault recovery of the MCU processor, and ensure the stability of the backup power supply. run.
Patent Information
- Application Number
- CN202111425065.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-27
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-11-27
AI Technical Summary
The MCU processor lacks a reset function after the program runs away, resulting in uncontrollable backup power switch and crashes, which affects users' use.
Design an MCU reset system, including a judgment module, a filter module and a reset output module. The judgment module judges the MCU processor signal, the filter module converts the signal into DC, the judgment module outputs the control signal to the reset output module, and the reset output module processes it to the MCU. The device outputs a reset signal, and uses a comparator and a transistor to implement the reset operation of the MCU processor.
It realizes the timely reset of the MCU processor after the program runs away, avoiding a crash and ensuring the stability of power consumption and normal operation.
Smart Images

Figure CN114115043B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of energy storage power supply industry, and in particular to an MCU reset system and a backup power supply having the same. Background Art
[0002] At present, residential and industrial electricity is basically connected to the municipal power grid and supplied directly by the municipal power grid. When the power is insufficient during the peak period, it is necessary to cut off industrial power supply to ensure residential power supply. Therefore, some enterprises need to suspend production and wait for power supply to be restored. In response to the above problems, some enterprises use backup power supplies to supply power for normal production when the municipal power grid cannot supply power normally. The advantage of using backup power supplies is that the backup power supply can be charged during the low power consumption period, and the backup power supply can be used for power supply during the peak power consumption period, which can greatly save electricity costs.
[0003] Currently, the backup power supply is controlled by a battery management system, whose core component is the MCU processor. Since the MCU processor has no reset function, when the internal program runs out of control, the tasks within the program will stop, causing the backup power switch to be uncontrollable, resulting in freezes and other phenomena, affecting user use. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide an MCU reset system which can realize a timely reset function after a program inside an MCU processor runs away and a backup power supply having the same.
[0005] The technical solution adopted by the present invention to solve its technical problem is: an MCU reset system, used for resetting an MCU processor, including a judgment module for receiving an MCU processor signal, a filtering module for filtering an MCU complex processor signal, and a reset output module for sending a reset signal. The MCU processor sends a task square wave signal or outputs no signal. The filtering module receives the task square wave signal and converts it into direct current and outputs it to the judgment module. The judgment module judges whether there is direct current input on the received signal. If not, a control signal is output to the reset output module, and the reset output module outputs a reset signal to the MCU processor.
[0006] To be more specific, the judgment module includes a first comparator and a second comparator. Different phase input ends of the first comparator and the second comparator simultaneously receive signals sent by the MCU processor. When the received signal is a task square wave signal, a high level signal is sent to the reset output module. When no signal is received, a low level signal is sent to the reset output module.
[0007] More specifically, potential pull-up resistors are provided at the output ends of the first comparator and the second comparator.
[0008] Further specifically, the judgment module includes an input end for receiving a task square wave signal and an output end for outputting a control signal, and the first comparator and the second comparator are arranged between the input end and the output end; pin 1 of the first comparator is connected to the input end after passing through a fourth resistor; pin 2 of the first comparator is divided into two paths, the first path is connected to a +5V potential after passing through a fifth resistor, and the second path is grounded after passing through a sixth resistor; pin 3 of the first comparator is grounded; pin 4 of the first comparator is connected to the output end; pin 5 of the first comparator is connected to a +5V potential; pin 1 of the second comparator is divided into two paths, the first path is grounded after passing through a first resistor, and the second path is connected to a +5V potential after passing through a second resistor; pin 2 of the second comparator is connected to the input end after passing through a third resistor; pin 3 of the second comparator is grounded; pin 4 of the second comparator is divided into two paths, the first path is connected to the output end, and the second path is connected to a +5V potential after passing through a seventh resistor; pin 5 of the second comparator is connected to a +5V potential.
[0009] More specifically, the reset output module includes a transistor, which turns on the transistor by sending a low level signal to the base of the transistor, so that the level at the emitter of the transistor is pulled down and the low level signal is sent to the MCU processor for reset.
[0010] Further specifically, the reset output module includes an input end for receiving a control signal and an output end for outputting a reset signal, the transistor is arranged between the input end and the output end, the base of the transistor is connected to the input end, the collector of the transistor is grounded, and the emitter of the transistor is divided into two paths, the first path is connected to the output end after passing through the first capacitor and the eighth resistor, and the second path is connected to the drive signal issued by the MCU processor through the diode and the ninth resistor, and the drive signal is connected to the relay; the output end is connected to the +3V potential after the tenth resistor.
[0011] More specifically, the transistor is a PNP MOS transistor or a bipolar junction transistor.
[0012] More specifically, the filtering module includes an input end for receiving a square wave signal and an output end for outputting direct current, an eleventh resistor is connected between the input end and the output end, and a second capacitor is connected to the output end and then grounded.
[0013] More specifically, the MCU processor is connected to a relay module, and the MCU processor sends a driving signal which is transmitted to the relay module after passing through a ninth resistor.
[0014] A backup power supply comprises the MCU reset system described above.
[0015] The beneficial effects of the present invention are as follows: a judgment module is used to judge whether the MCU processor is operating normally according to a task signal sent by the MCU processor, and a reset signal is sent to the MCU processor when it is operating abnormally. When the internal program of the MCU processor runs away, it can be reset and restarted in time to restore its normal operation. When a freeze state occurs, it can be restarted and restored in time to ensure power supply. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a structural block diagram of the MCU reset system of the present invention;
[0017] Figure 2 is a circuit diagram of an MCU reset system of the present invention;
[0018] Figure 3 It is a structural block diagram of the MCU reset system (with relay) of the present invention;
[0019] Figure 4 It is a circuit diagram of the reset system (with relay) of the present invention. DETAILED DESCRIPTION
[0020] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0022] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0023] like Figure 1-Figure 4 The MCU reset system shown is connected to the reset interface of the MCU processor and is used to reset the MCU processor. When the internal program of the MCU processor runs away or crashes, the MCU reset system detects the signal and sends a reset signal to the reset interface of the MCU processor, and the MCU processor restarts and resets.
[0024] The MCU reset system includes,
[0025] The judgment module is connected to the MCU processor and is used to judge the signal sent by the MCU processor and output the control signal to the reset output module after the judgment;
[0026] The reset output module is connected to the judgment module, receives the control signal sent by the judgment module, and outputs a reset signal to the reset interface of the MCU processor according to the control signal;
[0027] The filter module is connected between the MCU processor and the judgment module, and is used to convert the signal sent by the MCU processor into direct current and input it into the judgment module;
[0028] When the MCU processor is working normally, it sends out a task square wave signal. When the MCU processor is abnormal, it will not send out any signal. The filtering module converts the task square wave signal into direct current and inputs it into the judgment module. The judgment module is used to judge whether there is a task square wave signal input, that is, whether there is direct current input. If so, it proves that the MCU processor is working normally and there is no need to restart the MCU processor. If not, it proves that the MCU processor is in an abnormal state and it is necessary to restart the MCU processor to restore its working state. The judgment module sends a control signal to the reset output module, and the reset output module outputs a reset signal to the reset interface of the MCU processor, and the MCU processor completes the reset operation.
[0029] Among them, the judgment module includes a first comparator U1 and a second comparator U2, and the first comparator U1 and the second comparator U2 are used as core components to judge the input of the signal. The different phase input ends of the first comparator U1 and the second comparator U2 simultaneously receive the signal sent by the MCU processor. When the received signal is a task square wave signal, that is, direct current, the output ends of the first comparator U1 and the second comparator U2 simultaneously send a high-level signal to the reset output module. At the same time, in order to ensure that the output high-level signal is stable when the MCU processor is working normally, a potential pull-up resistor is provided at the output end of the first comparator U1 and the second comparator U2; and when no signal is received, at this time, at least one of the first comparator U1 or the second comparator U2 sends a low-level signal to the reset output module; the high-level signal corresponds to the normal operation of the MCU processor, and the low-level signal corresponds to the abnormal operation of the MCU processor.
[0030] Based on the core components of the above judgment module, the circuit is designed as follows:
[0031] The judgment module includes an input terminal for receiving a task square wave signal and an output terminal for outputting a control signal. The first comparator U1 and the second comparator U2 are arranged between the input terminal and the output terminal; the pin 1 of the first comparator U1 is connected to the input terminal through a fourth resistor R4; the pin 2 of the first comparator U1 is divided into two paths, the first path is connected to a +5V potential through a fifth resistor R5, and the second path is grounded through a sixth resistor R6; the pin 3 of the first comparator U1 is grounded; the pin 4 of the first comparator U1 is connected to the output terminal; the first comparator Pin 5 of the comparator U1 is connected to a +5V potential; Pin 1 of the second comparator U2 is divided into two paths, the first path is connected to ground after passing through a first resistor R1, and the second path is connected to a +5V potential after passing through a second resistor R2; Pin 2 of the second comparator U2 is connected to an input terminal after passing through a third resistor R3; Pin 3 of the second comparator U2 is grounded; Pin 4 of the second comparator U2 is divided into two paths, the first path is connected to an output terminal, and the second path is connected to a +5V potential after passing through a seventh resistor R7 (pull-up resistor); Pin 5 of the second comparator U2 is connected to a +5V potential.
[0032] The task square wave signal processed by the filtering module becomes direct current and enters the input end of the judgment module and is divided into two paths. The first path passes through the fourth resistor R4 and enters the non-inverting input end of the first comparator U1, that is, pin 1 of the first comparator U1. The second path passes through the third resistor R3 and enters the inverting input end of the second comparator U2, that is, pin 2 of the second comparator U2. Due to the voltage division of the first resistor R1 and the second resistor R2 on the positive input end of the second comparator U2, and the voltage division of the fifth resistor R5 and the sixth resistor R6 on the inverting input end of the first comparator U1, the voltage of the direct current is less than the voltage division of the positive input end of the second comparator U2 and greater than the voltage division of the inverting input end of the first comparator U1. The output ends of the first comparator U1 and the second comparator U2 output a high impedance state. At this time, the potential of the output end is pulled to +5V by the seventh resistor R7.
[0033] The reset output module includes a transistor Q1, which is a PNP MOS tube or a bipolar junction transistor. The emitter of the transistor Q1 is connected to the output end, and the base of the transistor Q1 is connected to the input end. Its purpose is to turn on the transistor Q1 when the base of the transistor Q1 receives a low-level signal, so that the level at the emitter of the transistor Q1 is pulled down and the low-level signal is input to the reset interface of the MCU processor through the output end, and the MCU processor performs a reset operation.
[0034] Based on the core component transistor Q1 of the above reset output module, the circuit is designed as follows:
[0035] The reset output module includes an input end for receiving a control signal and an output end for outputting a reset signal. The transistor Q1 is arranged between the input end and the output end. The base of the transistor Q1 is connected to the input end, the collector of the transistor Q1 is grounded, and the emitter of the transistor Q1 is divided into two paths. The first path is connected to the output end after passing through the first capacitor C1 and the eighth resistor R8, and the second path is connected to the drive signal issued by the MCU processor through the diode D1 and the ninth resistor R9. At the same time, the drive signal is connected to the relay; the output end is connected to the tenth resistor R10 and then connected to the +3V potential.
[0036] The judgment module outputs a high-level or low-level signal. When it is a high-level signal, the transistor Q1 will not be turned on. At this time, the output end is in a high-level state and no reset action will be performed; when it is a low-level signal, the transistor Q1 is turned on to lower the level of the output end of the reset output module. At this time, due to the action of the first capacitor C1 and the eighth resistor R8, the output reset signal becomes a high level after lasting for 1s. This circuit uses the first capacitor C1 as a medium. When a fault occurs, the level signal of the output end will be temporarily lowered, and then the level signal of the output end will be restored to +3V. The MCU processor restarts and resumes the task normally, completing the self-restart recovery of the fault; if the first capacitor C1 is not used as a medium, the reset signal will be sent to the MCU processor all the time, and the task square wave signal will not be sent, which will cause it to be in a restart state all the time.
[0037] The filter module includes an input end for receiving a task square wave signal and an output end for outputting direct current. An eleventh resistor R11 is connected between the input end and the output end, and a second capacitor C2 is connected to the output end and then grounded to realize conversion of the task square wave signal into a direct current signal.
[0038] In order to facilitate the control of the relay on the battery and ensure that the relay is disconnected after the MCU processor program fails, the relay is connected between the ninth resistor R9 and the diode D1, that is, the MCU processor sends a driving signal through the ninth resistor R9 and then transmits it to the relay module for controlling the relay. When the program in the MCU processor fails, the transistor Q1 in the reset output module is turned on and the relay level is pulled down through the ninth resistor R9, driving the relay to disconnect and ensuring that the battery is disconnected.
[0039] The above system is applied to the backup power supply to facilitate enterprises to automatically restart and recover when the program in the MCU processor fails during use.
[0040] In summary, according to the task signal sent by the MCU processor, a high level or low level signal can be sent after being processed by the first comparator and the second comparator inside the judgment module. The high level signal corresponds to normal operation, and the low level signal corresponds to abnormal operation. The high level signal will not activate the reset output module; the low level signal activates the reset output module, so that the transistor in the reset output module is turned on, and the level of the output end of the reset output module is pulled down. The low level activates the reset interface of the MCU processor to restart the operation. At the same time, the low level of the output end of the reset output module continues for a short time to restore to a high level, which can prevent the MCU processor from repeatedly restarting; when faults such as program running away and freezing occur, it can automatically restart and restore the working state.
[0041] It should be emphasized that the above are only preferred embodiments of the present invention and do not limit the present invention in any form. Any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. An MCU reset system, used to reset an MCU processor, characterized in that: The invention comprises a judgment module for receiving MCU processor signals, a filtering module for filtering MCU processor signals and a reset output module for sending a reset signal. The MCU processor sends a task square wave signal or no signal output. The filtering module receives the task square wave signal and converts it into direct current and outputs it to the judgment module. The judgment module judges whether there is direct current input for the received signal. If not, a control signal is output to the reset output module, and the reset output module outputs a reset signal to the MCU processor. The reset output module includes a triode, which is turned on by sending a low level signal to the base of the triode, so that The level on the emitter of the transistor is pulled down and the low-level signal is sent to the MCU processor for reset; the reset output module includes an input end for receiving a control signal and an output end for outputting a reset signal, the transistor is arranged between the input end and the output end, the base of the transistor is connected to the input end, the collector of the transistor is grounded, the emitter of the transistor is divided into two paths, the first path is connected to the output end after passing through the first capacitor and the eighth resistor, and the second path is connected to the drive signal sent by the MCU processor through the diode and the ninth resistor, and the drive signal is connected to the relay; the output end is connected to the +3V potential after the tenth resistor is connected.
2. The MCU reset system according to claim 1, characterized in that: The judgment module includes a first comparator and a second comparator. Different phase input ends of the first comparator and the second comparator simultaneously receive signals sent by the MCU processor. When the received signal is a task square wave signal, a high level signal is sent to the reset output module. When no signal is received, a low level signal is sent to the reset output module.
3. The MCU reset system according to claim 2, characterized in that: Potential pull-up resistors are arranged at the output ends of the first comparator and the second comparator.
4. The MCU reset system according to claim 3, characterized in that: The judgment module includes an input terminal for receiving a task square wave signal and an output terminal for outputting a control signal. The first comparator and the second comparator are arranged between the input terminal and the output terminal; the pin 1 of the first comparator is connected to the input terminal through a fourth resistor; the pin 2 of the first comparator is divided into two paths, the first path is connected to a +5V potential through a fifth resistor, and the second path is connected to ground through a sixth resistor; the pin 3 of the first comparator is grounded; the pin 4 of the first comparator is connected to the output terminal; the pin 5 of the first comparator is connected to a +5V potential; The pin 1 of the second comparator is divided into two paths, the first path is connected to the ground after passing through the first resistor, and the second path is connected to the +5V potential after passing through the second resistor; the pin 2 of the second comparator is connected to the input end after passing through the third resistor; the pin 3 of the second comparator is grounded; the pin 4 of the second comparator is divided into two paths, the first path is connected to the output end, and the second path is connected to the +5V potential after passing through the seventh resistor; Pin 5 of the second comparator is connected to a +5V potential.
5. The MCU reset system according to claim 1, characterized in that: The transistor is a PNP MOS transistor or a bipolar junction transistor.
6. The MCU reset system according to claim 1, characterized in that: The filtering module comprises an input end for receiving a square wave signal and an output end for outputting direct current, an eleventh resistor is connected between the input end and the output end, and a second capacitor is connected to the output end and then grounded.
7. The MCU reset system according to claim 1, characterized in that: The MCU processor is connected to a relay module, and the MCU processor sends a driving signal which is transmitted to the relay module after passing through a ninth resistor.
8. A backup power supply, characterized in that: The MCU reset system comprises any one of claims 1 to 7.
Citation Information
Patent Citations
MCU reset and restart method and circuit
CN111090548A
Power supply system
CN208190329U
