CN112084054A - Watchdog circuit, and dog feeding method and device - Google Patents

Watchdog circuit, and dog feeding method and device Download PDF

Info

Publication number
CN112084054A
CN112084054A CN202010827886.2A CN202010827886A CN112084054A CN 112084054 A CN112084054 A CN 112084054A CN 202010827886 A CN202010827886 A CN 202010827886A CN 112084054 A CN112084054 A CN 112084054A
Authority
CN
China
Prior art keywords
dog feeding
dog
resistor
feeding
schmitt trigger
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010827886.2A
Other languages
Chinese (zh)
Inventor
王君龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Cisco Networking Technology Co Ltd
Original Assignee
Inspur Cisco Networking Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Cisco Networking Technology Co Ltd filed Critical Inspur Cisco Networking Technology Co Ltd
Priority to CN202010827886.2A priority Critical patent/CN112084054A/en
Publication of CN112084054A publication Critical patent/CN112084054A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/0757Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a watchdog circuit and a method and equipment for feeding dogs, wherein the circuit comprises: the coupling module comprises a first capacitor, the input end of the coupling module receives the dog feeding signal sent by the corresponding program, and the output end of the coupling module is connected with the base electrode of the triode; a collector of the triode is connected with the input end of the Schmidt trigger, and the collector of the triode is grounded after being connected with the second capacitor; and the input end of the Schmitt trigger is connected with the second capacitor and then grounded, the output end of the Schmitt trigger is used for outputting a reset signal, and the Schmitt trigger is connected with a first resistor in parallel. Compared with a built-in watchdog chip, the watchdog chip has the independent external timer, the watchdog chip does not need to be homologous with a system clock, and the reset operation can be executed even if the system clock is abnormal. Compared with an external watchdog chip, the watchdog chip has the advantages that the cost of the adopted components is low, and therefore the overall price is low compared with the existing external watchdog chip. And the C2 charging speed can be increased or decreased by modifying the values of R1 and C2, namely the maximum feeding time of the watchdog circuit can be configured.

Description

Watchdog circuit, and dog feeding method and device
Technical Field
The application relates to the field of watchdog, in particular to a watchdog circuit, a watchdog feeding method and watchdog feeding equipment.
Background
The watchdog circuit is used for monitoring the running state of the program. When the program runs normally, the watchdog outputs a level signal with variable height, and when the program runs abnormally, the level of the output signal is kept unchanged. When the level does not change and exceeds the maximum dog feeding time interval, the watchdog circuit generates a low level, and the signal is usually connected to a reset pin of the system to reset the system and exit from an abnormal state.
The existing commonly used watchdog circuit is divided into a chip built-in circuit and an independent external circuit, but the existing watchdog circuit still has some problems:
for the type with built-in chip, the built-in watchdog is homologous with the system clock, and when the system clock is abnormal, the risk of being unable to reset exists. For the independent external type, the special external watchdog chip is usually high in price, so that the cost is high, and the maximum dog feeding time cannot be configured.
Disclosure of Invention
In order to solve the above problems, the present application provides a watchdog circuit, which includes a coupling module, a triode, and a schmitt trigger; the coupling module comprises a first capacitor, the input end of the coupling module is used for receiving a dog feeding signal sent by a corresponding program, and the output end of the coupling module is connected with the base electrode of the triode; the collector of the triode is connected with the input end of the Schmidt trigger, the collector is also connected with the second capacitor and then grounded, and the emitter is grounded; the input end of the Schmitt trigger is connected with the second capacitor and then grounded, the output end of the Schmitt trigger is used for outputting a reset signal, and the Schmitt trigger is also connected with a first resistor in parallel.
In one example, the collector of the triode is connected with the input end of the Schmitt trigger after being connected with the second resistor; the Schmitt trigger outputs a reset signal after passing through the third resistor and is connected with a power supply after passing through the third resistor and the fourth resistor.
In one example, the resistance value of the second resistor is much smaller than the resistance values of the first resistor, the third resistor and the fourth resistor, and the much smaller value indicates that the resistance values are not of the same order of magnitude.
In one example, the corresponding program is U-boot.
In another aspect, the present application further provides a method for feeding a watchdog circuit, which is applied to the watchdog circuit according to any one of the above examples, and the method includes: initializing a counter, and setting the current dog feeding times as the maximum dog feeding times; executing a virtual dog feeding action, and decrementing the current dog feeding times according to the virtual dog feeding action; after the timer is delayed and is interrupted overtime, monitoring whether the current dog feeding times are 0 or the maximum dog feeding times in the timer period by an interrupt service program; if so, not reversing the level of the dog feeding signal, and not executing the actual dog feeding action; otherwise, the level of the dog feeding signal is reversed, and the actual dog feeding action is executed.
In one example, the method further comprises: resetting the current dog feeding times corresponding to the counter to be the maximum dog feeding times through the interrupt service program; repacking the timer to facilitate re-execution of the virtual feed dog action.
In one example, prior to initializing the counter, the method further comprises: enabling CPU interrupt, and configuring a timer period, an interrupt priority and an interrupt vector, wherein the CPU is the CPU of a system for resetting the watchdog circuit, and the timer period is less than 1/2 of the maximum dog feeding time of the watchdog circuit.
In one example, before enabling the CPU interrupt and configuring the timer period, the interrupt priority, and the interrupt vector, the method further comprises: the dog feed pin is initialized as the push-pull output.
In one example, the method is performed based on a U-boot.
On the other hand, the present application also provides a watchdog circuit feeding apparatus, applied to the watchdog circuit according to any one of the above examples, the apparatus including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to: initializing a counter, and setting the current dog feeding times as the maximum dog feeding times; executing a virtual dog feeding action, and decrementing the current dog feeding times according to the virtual dog feeding action; after the timer is delayed and is interrupted overtime, monitoring whether the current dog feeding times are 0 or the maximum dog feeding times in the timer period by an interrupt service program; if so, not reversing the level of the dog feeding signal, and not executing the actual dog feeding action; otherwise, the level of the dog feeding signal is reversed, and the actual dog feeding action is executed.
The watchdog circuit and the dog feeding method provided by the application can bring the following beneficial effects:
compared with a built-in watchdog chip, the watchdog chip has the independent external timer, the watchdog chip does not need to be homologous with a system clock, and the reset operation can be executed even if the system clock is abnormal. Compared with an external watchdog chip, the watchdog chip has the advantages that the cost of the adopted components is low, and therefore the overall price is low compared with the existing external watchdog chip. In addition, the charging speed of the C2 can be increased or decreased by modifying the values of the first resistor R1 and the second capacitor C2, so that the maximum feeding time of the watchdog circuit can be configured, and the watchdog circuit is very convenient.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic flow chart illustrating a method for feeding a watchdog circuit according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a dog feeding apparatus of a watchdog circuit in an embodiment of the present application;
FIG. 3 is a circuit diagram of a watchdog circuit in an embodiment of the present application;
fig. 4 is a specific flowchart of a dog feeding method of a watchdog circuit in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
As shown in fig. 3, an embodiment of the present application provides a watchdog circuit, including: coupling module, triode, schmitt trigger.
The coupling module may be an RC coupling circuit, and may include a fifth resistor R5 and a capacitor C1, one end of the fifth resistor R5 is configured to receive a DOG feeding signal FEED _ DOG sent by a corresponding program, the other end of the fifth resistor R5 is connected to the capacitor C1, the other end of the capacitor C1 is connected to a base of the transistor Q1, and the other end of the capacitor C1 is also grounded through the sixth resistor R6.
The transistor Q1 may be of any suitable type, such as 2N3904 shown in fig. 3, but may be of other types. The base electrode of the triode Q1 is connected with the other end of the capacitor C1, the emitting electrode is grounded, and the collecting electrode is connected with the input end of the Schmitt trigger U. The collector of the transistor Q1 is also connected to the second capacitor C2 and then grounded. Of course, the collector of the transistor may be connected to the input terminal of the schmitt trigger after being connected to the second resistor R2.
The schmitt trigger, which can also be called a schmitt inverter, is an inverter with a schmitt trigger function, and trigger level thresholds of positive transition and negative transition of an input end of the inverter are different. The input end of the Schmitt trigger is connected with the second capacitor C2 and then grounded, the output end of the Schmitt trigger is used for outputting a RESET signal SYS _ RESET, and the Schmitt trigger is also connected with a first resistor R1 in parallel. The Schmitt trigger can also output a reset signal through a third resistor R3, is connected with a power supply through a third resistor R3 and a fourth resistor R4, and is grounded at the output end through a third capacitor C3. By utilizing the characteristics of the Schmitt trigger, the input capacitor C2 and the feedback resistor R5 are combined to generate a periodic low-level signal at the output end of the Schmitt trigger. The dog feeding signal is connected to the input end of the Schmitt trigger through the RC coupling circuit, and the input end of the Schmitt trigger can be maintained below a positive jump threshold value through periodically charging and discharging an input capacitor C2 of the Schmitt trigger, so that the output end can not generate a low-level signal.
When the watchdog circuit in the embodiment of the present application works, the specific working process may be as follows:
when no dog feeding signal is input, the base level of the transistor Q1 is 0, and the transistor Q1 operates in an off state.
When no dog feeding signal is input, the initial voltage value at the two ends of the second capacitor C2 is 0. At this time, the output terminal of the schmitt trigger U is at a high level of 3.3V, and the voltage drives the fourth resistor R4, the third resistor R3, and the first resistor R1 to generate current to charge the second capacitor C2, so that the voltage across the second capacitor C2 gradually increases. When the voltage of the second capacitor C2 reaches the positive transition threshold voltage of the input terminal of the schmitt trigger U, the level of the output terminal jumps to 0, and at this time, the high voltage is still maintained across the second capacitor C2, which drives the first resistor R1 to discharge, and the voltage of the second capacitor C2 starts to decrease. When the voltage of the second capacitor C2 is lower than the negative transition threshold voltage of the Schmitt trigger, the output end of the Schmitt trigger U outputs high level again. Under the condition, the Schmitt trigger works in an oscillation output state, the output end periodically outputs a low-level signal, and the system is periodically reset.
When a feeding DOG signal is input, the FEED _ DOG signal passes through the RC coupling circuit to generate a square wave at the base stage of the transistor Q1, and the square wave signal and the FEED _ DOG signal are in phase. When the fed _ DOG input is low, the transistor Q1 is turned off, the circuit operates in the above-mentioned oscillation output state, and the second capacitor C2 is periodically charged and discharged. When the fed _ DOG inputs a high level, the transistor Q1 is in saturation conduction, and the second capacitor C2 discharges through the second resistor R2 and the transistor Q1, so that the voltage at the two ends of the second capacitor C2 is prevented from rising, and the output end SYS _ RESET of the schmitt trigger maintains a high level. At this time, the resistance value of the second resistor R2 can be set to be much smaller than the fourth resistor R4, the third resistor R3 and the first resistor R1, so that the discharging speed and the charging speed of the second capacitor C2 can be made slow, and as long as the fed _ DOG duty ratio is larger than a certain value, the voltage of the second capacitor C2 will be maintained below the positive transition threshold, the SYS _ RESET signal will be maintained at a high level, and the system will not be RESET. By much smaller is meant that the resistance values are not of the same order of magnitude.
When the feeding DOG signal stops inputting, the FEED _ DOG maintains a high level or a low level or a high resistance state, after passing through the RC coupling circuit, the base level voltage of the triode Q1 is always 0V and is in a cut-off state, the Schmitt trigger U enters an oscillation output state again, and the system is reset periodically.
When a common DOG feeding method is used, the duty ratio of the FEED _ DOG is difficult to control, when the duty ratio is lower than a specific value, the charging time of the C2 is too long, the discharging time is too short, the voltage at two ends of the C2 cannot be maintained below a positive transition threshold value, the output end of the inverter outputs a low level to SYS _ RESET, and the system is RESET. In the embodiment of the present application, the charging speed of C2 can be increased or decreased by modifying the values of the first resistor R1 and the second capacitor C2, so that the maximum dog feeding time of the watchdog circuit can be configured. Wherein, when the first resistor R1 and the second capacitor C2 are increased, the maximum dog feeding time is increased; conversely, when the first resistor R1 and the second capacitor C2 are reduced, the maximum dog feeding time is reduced.
In the embodiment of the present application, as shown in fig. 3, the following setting may be performed for the parameters of each element: the resistance value of the fifth resistor R5 is set to 1K, the resistance value of the sixth resistor R6 is set to 10K, the resistance value of the second resistor is set to 300, the resistance value of the third resistor is set to 2K, the resistance value of the fourth resistor is set to 10K, and the resistance value of the first resistor is set to 1M. The capacitance of the first capacitor C1 was set to 1uF, the capacitance of the second capacitor C2 was set to 4.7uF, and the capacitance of the third capacitor C3 was set to 1 nF. Of course, this is only an example in the embodiment of the present application, and the specifically set numerical value may be modified according to the actual working condition.
In one embodiment, the corresponding program for triggering the feeding dog signal may be a U-boot. The U-boot is a boot loader mainly used for an embedded system and can support various computer system structures. For the external watchdog, a common feeding method in the U-boot is to estimate a time interval in a sequentially executed code, perform an operation of reversing a level on a feeding pin, and perform level reversal on the feeding pin once per cycle in a code which is executed cyclically and has a long time. Under the condition that the code frequently jumps, the level turnover frequency and the high-low level duty ratio of the actual dog feeding pin present certain randomness. In a system based on the existing watchdog circuit, when the duty ratio is too low, namely the invalid dog feeding time is greater than the valid dog feeding time by a certain proportion, the system is reset, and the accidental restart is caused. Through the watchdog circuit in the embodiment of the application, the system reliability can be effectively improved due to the characteristic of the Schmitt trigger. And the hardware cost can be reduced by being equivalent to an external watchdog chip, the maximum dog feeding interval time can be flexibly configured, and the circuit is particularly suitable for a watchdog circuit under a U-boot.
As shown in fig. 1 and fig. 4, the present application further provides a method for feeding a watchdog circuit, which is applied to the watchdog circuit according to any one of the above embodiments, and the method includes:
s101, initializing a counter, and setting the current dog feeding times as the maximum dog feeding times.
When feeding dogs, the initialization setting can be firstly carried out on the dog feeding pins, namely the initialization of the GPIO (general purpose input/output) of the dog feeding pins, and the initialization of the dog feeding pins is push-pull output. And then after the CPU is enabled to be interrupted, corresponding configuration is carried out on the timer period, the interrupt priority, the interrupt vector and the like so as to facilitate the follow-up dog feeding action. Here, the CPU refers to a CPU of a system in which the watchdog circuit is used for resetting. And when the timer period is set, 1/2 which is smaller than the maximum dog feeding time of the watchdog circuit can be set in the timer period, so that the dog feeding action can be normally executed when the CPU normally runs.
Then, when performing the dog feeding action, the counter may be initialized first, and then the current number of times of dog feeding counter may be set to the maximum number of times of dog feeding max. The counter is usually externally provided, and the setting of the maximum number of dog-feeds max has the following requirements: when the program (explained in the embodiment of the present application by taking U-boot as an example) is normally running, the actual number of dog-feeds per timer period is smaller than the maximum number of dog-feeds max.
And S102, executing a virtual dog feeding action, and decreasing the current dog feeding times according to the virtual dog feeding action.
After the corresponding configuration is completed, the timer interrupt may be first enabled to perform the virtual dog feeding action within the current round of timer period. The virtual dog feeding action herein means that the dog feeding action is not actually performed, but is assumed to have been actually performed. And when the virtual dog feeding action is executed, the virtual dog feeding action can be executed through the U-boot main function, the virtual dog feeding action is carried out according to a normal method, and the current dog feeding frequency counter is decreased while the virtual dog feeding action is executed. And performing virtual dog feeding operation during sequential execution and circular execution (such as kernel decompression, reading or other required circular operation which takes a long time) of the U-boot code. The reading, decompressing and other operations can be realized by a built-in program in the U-boot, and are not described herein again.
S103, after the timer is delayed and is interrupted overtime, monitoring whether the current dog feeding frequency is 0 or the maximum dog feeding frequency in the timer period through an interrupt service program.
After the timer is delayed for a certain time, when the preset time duration is reached and exceeded, the timer is interrupted, at this time, the timer period of the current round is ended, and whether the counter is equal to 0 or max can be judged through the interrupt service program. The interrupt service program may be a program, a script, a code, etc. capable of playing corresponding functions, and the interrupt service program may be embedded in the U-boot or may be a separate program, which is not described herein again.
It should be noted that, when the timer is externally installed, the system clock is abnormal, the timer is not affected, and the system can be reset normally. When the timer is built in the CPU, even if the timer is built in the CPU and may be homologous with the system clock, when the system clock is abnormal, the timer interrupt service program will not be executed by the CPU, that is, the actual dog feeding operation will not be executed, so the system can be reset normally.
And S104, if so, not reversing the level of the dog feeding signal, and not executing the actual dog feeding action.
And S105, if not, inverting the level of the dog feeding signal and executing the actual dog feeding action.
If counter is 0, it indicates that the number of virtual feeding DOGs in the current round of timer period which has ended exceeds max, indicating that the program execution sequence is out of expectation, and the fed _ DOG signal level is not inverted, i.e. actual feeding DOGs are not executed. If counter is max, it indicates that no virtual feeding is performed in the current round of timer period, and at this time, the fed _ DOG signal level is not inverted, i.e. no actual feeding action is performed.
If the counter is the other value, the actual hardware Dog feeding operation Feed _ Dog () can be executed, and the Feed _ Dog signal level in the circuit is inverted to perform the actual Dog feeding operation.
After the timer period of the round is finished, the current dog feeding times counter of the counter can be reset to the maximum dog feeding times max through the interrupt service program, and then the timer is reloaded so as to re-execute the virtual dog feeding action to carry out the dog feeding action of the next round.
As shown in fig. 2, an embodiment of the present application further provides a watchdog circuit feeding apparatus, which is applied to the watchdog circuit according to any one of the above embodiments, and the apparatus includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform:
initializing a counter, and setting the current dog feeding times as the maximum dog feeding times;
executing a virtual dog feeding action, and decrementing the current dog feeding times according to the virtual dog feeding action;
after the timer is delayed and is interrupted overtime, monitoring whether the current dog feeding times are 0 or the maximum dog feeding times in the timer period by an interrupt service program;
if so, not reversing the level of the dog feeding signal, and not executing the actual dog feeding action;
otherwise, the level of the dog feeding signal is reversed, and the actual dog feeding action is executed.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the device and media embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference may be made to some descriptions of the method embodiments for relevant points.
The device and the medium provided by the embodiment of the application correspond to the method one to one, so the device and the medium also have the similar beneficial technical effects as the corresponding method, and the beneficial technical effects of the method are explained in detail above, so the beneficial technical effects of the device and the medium are not repeated herein.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A watchdog circuit is characterized by comprising a coupling module, a triode and a Schmitt trigger;
the coupling module comprises a first capacitor, the input end of the coupling module is used for receiving a dog feeding signal sent by a corresponding program, and the output end of the coupling module is connected with the base electrode of the triode;
the collector of the triode is connected with the input end of the Schmidt trigger, the collector is also connected with the second capacitor and then grounded, and the emitter is grounded;
the input end of the Schmitt trigger is connected with the second capacitor and then grounded, the output end of the Schmitt trigger is used for outputting a reset signal, and the Schmitt trigger is also connected with a first resistor in parallel.
2. The circuit of claim 1, wherein the transistor has a collector connected to the second resistor and then to the input of the schmitt trigger;
the Schmitt trigger outputs a reset signal after passing through the third resistor and is connected with a power supply after passing through the third resistor and the fourth resistor.
3. The circuit of claim 2, wherein the resistance value of the second resistor is much smaller than the resistance values of the first resistor, the third resistor, and the fourth resistor, and the much smaller value indicates that the resistance values are not of the same order of magnitude.
4. The circuit of claim 1, wherein the corresponding program is U-boot.
5. A method for feeding a watchdog circuit, the method being applied to the watchdog circuit according to any one of claims 1 to 4, the method comprising:
initializing a counter, and setting the current dog feeding times as the maximum dog feeding times;
executing a virtual dog feeding action, and decrementing the current dog feeding times according to the virtual dog feeding action;
after the timer is delayed and is interrupted overtime, monitoring whether the current dog feeding times are 0 or the maximum dog feeding times in the timer period by an interrupt service program;
if so, not reversing the level of the dog feeding signal, and not executing the actual dog feeding action;
otherwise, the level of the dog feeding signal is reversed, and the actual dog feeding action is executed.
6. The method of claim 5, further comprising:
resetting the current dog feeding times corresponding to the counter to be the maximum dog feeding times through the interrupt service program;
repacking the timer to facilitate re-execution of the virtual feed dog action.
7. The method of claim 5, wherein prior to initializing the counter, the method further comprises:
enabling CPU interrupt, and configuring a timer period, an interrupt priority and an interrupt vector, wherein the CPU is the CPU of a system for resetting the watchdog circuit, and the timer period is less than 1/2 of the maximum dog feeding time of the watchdog circuit.
8. The method of claim 7, wherein prior to enabling CPU interrupts and configuring the timer period, interrupt priority, and interrupt vector, the method further comprises:
the dog feed pin is initialized as the push-pull output.
9. The method of claim 5, wherein the method is performed based on a U-boot.
10. A watchdog circuit feeding apparatus for a watchdog circuit, the watchdog circuit feeding apparatus being adapted according to any one of claims 1 to 4, the apparatus comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform:
initializing a counter, and setting the current dog feeding times as the maximum dog feeding times;
executing a virtual dog feeding action, and decrementing the current dog feeding times according to the virtual dog feeding action;
after the timer is delayed and is interrupted overtime, monitoring whether the current dog feeding times are 0 or the maximum dog feeding times in the timer period by an interrupt service program;
if so, not reversing the level of the dog feeding signal, and not executing the actual dog feeding action;
otherwise, the level of the dog feeding signal is reversed, and the actual dog feeding action is executed.
CN202010827886.2A 2020-08-17 2020-08-17 Watchdog circuit, and dog feeding method and device Pending CN112084054A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010827886.2A CN112084054A (en) 2020-08-17 2020-08-17 Watchdog circuit, and dog feeding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010827886.2A CN112084054A (en) 2020-08-17 2020-08-17 Watchdog circuit, and dog feeding method and device

Publications (1)

Publication Number Publication Date
CN112084054A true CN112084054A (en) 2020-12-15

Family

ID=73729679

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010827886.2A Pending CN112084054A (en) 2020-08-17 2020-08-17 Watchdog circuit, and dog feeding method and device

Country Status (1)

Country Link
CN (1) CN112084054A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113162602A (en) * 2021-04-17 2021-07-23 青岛京先仪表有限公司 Low-cost watchdog circuit design realized by using gate circuit
CN113886123A (en) * 2021-09-30 2022-01-04 蜂巢能源科技有限公司 Watchdog feeding method and device, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113162602A (en) * 2021-04-17 2021-07-23 青岛京先仪表有限公司 Low-cost watchdog circuit design realized by using gate circuit
CN113886123A (en) * 2021-09-30 2022-01-04 蜂巢能源科技有限公司 Watchdog feeding method and device, electronic equipment and storage medium
CN113886123B (en) * 2021-09-30 2023-06-30 蜂巢能源科技有限公司 Watchdog feeding method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107770088B (en) Flow control method and device
CN112084054A (en) Watchdog circuit, and dog feeding method and device
CN108984219B (en) Memory parameter configuration method and electronic equipment
CN110704090B (en) FPGA (field programmable Gate array) and upgrading method and upgrading system thereof
CN111143104A (en) Memory exception processing method and system, electronic device and storage medium
CN110162573B (en) Distributed sequence generation method, device and system
CN108536613B (en) Data cleaning method and device and server
KR19990007309A (en) How to reset the system
CN103890713A (en) Apparatus and method for managing register information in a processing system
CN103823711A (en) Method and device for providing relative timing in Java virtual machine
CN111798905A (en) Method, system, storage medium and terminal for reducing programming time of non-flash memory
CN116450224A (en) Data recovery method, device and system based on clearing CMOS
CN111124811A (en) Method, system and device for acquiring SSD data retention time
CN111140529B (en) Blower control method, blower control device and storage medium
CN116560678A (en) Firmware updating method and device, storage medium and electronic device
CN111025178B (en) Stability test method for main-standby switching of power supply module and related components
CN104572332A (en) Method and device for processing system crash
CN112947841A (en) Method, device, equipment and storage medium for reading embedded flash memory data
CN104035784B (en) A kind of equipment activation system and method
CN111506256B (en) Method for reducing write performance variation and preventing IO blocking
CN111597016B (en) System task time protection method, system, storage medium and terminal
CN116093885B (en) Low-voltage protection method and device applied to model airplane electronic speed regulator
CN112805978A (en) Enhanced anchor protocol for event stream processing
CN108255667A (en) A kind of business monitoring method, device and electronic equipment
CN112394800A (en) Chip resetting method and system, storage medium and electronic equipment

Legal Events

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