The Role and Difference Between Software Watchdog and Hardware Watchdog
Industrial cellular routers, as very important devices in wireless networking, have insight into customer application scenarios. As long as it is related to the reliability of wireless networking, even the most subtle technical applications should be excellent, such as guard dogs. Why do Industrial cellular routers attach so much importance to hardware and software watchdog, today we will take a look at the similarities between these devices.
A watchdog, also called a watchdog timer, is a timer circuit, Generally has an input, called feed the dog, an output to the MCU RST end, MCU normal work, and every once in a while output a signal to feed the dog end, to clear WDT, if exceed the specified time not to feed the dog (generally in the program to run away), WDT timing exceed, will give a reset signal to MCU, make MCU reset. Prevent the MCU from shutting down. The watchdog is there to keep the program from going into a loop or running away.
Working principle: After the system is running, the watchdog counter is started, and the watchdog begins to count automatically. If the watchdog is not cleared within a certain time, then the watchdog counter will overflow and cause the watchdog to interrupt, causing the system to reset. So the use of a watchdog chip to pay attention to clear the watchdog.
The hardware watchdog uses a timer to monitor the running of the main program, which means that during the running of the main program, we have to reset the timer before the timer expires if there is an endless loop, or the PC pointer doesn't come back. Then when the timing time is up, it will reset the MCU.
The principle of software watchdog technology is similar to this, but it is realized by software. We still use the 51 series. We know that there are two timers in 51 microcontrollers, and we can use these two timers to monitor the operation of the main program. We can set a certain timing time for T0, when the timing interrupt occurs, to assign a value to a variable, and this variable has an initial value at the beginning of the main program running, here we want to set a fixed time value less than the running time of the main program, so that at the end of the main program to judge the value of the variable if the value has changed as expected, It means that the T0 interrupt is normal, and if there is no change, the program will be reset.
For T1 we use to monitor the operation of the main program, we set a certain timing time for T1, and reset it in the main program. If it cannot be reset in a certain time, the timing interrupt of T1 will reset the MCU. Here, the timing time of T1 should be set to be larger than the running time of the main program, leaving a certain margin for the main program. And T1 interrupt normal or not we by T0 timing interrupt subroutine to monitor. This is enough to become a cycle, T0 monitors T1, T1 monitors the main program, and the main program monitors T0, so as to ensure the stable operation of the system.
The main similarities and differences between software and hardware watchdog.
The similarities are as follows:
1) Both are achieved by timer; Reset the timer without feeding the dog.
2) It is necessary to feed the dog within the specified time.
3) Both rely on software to feed dogs.
The main differences are as follows:
1) Additional features: Hardware watchdog chips generally come with delayed reset and power testing capabilities, but the software does not.
2) Shielding method: The software watchdog is easy to mask off, only need to modify the register, and the hardware watchdog once started power can not stop.
3) Startup mode: software watchdog is easy to start, just modify the register in it. The hardware is generally started after receiving the first signal to feed the dog.
4) Initialization: hardware watchdog completes initialization when it receives the first feeding pulse after power-on, while the software watchdog needs to configure relevant registers (or call relevant watchdog subroutines).
Industrial router watchdog design
Industrial cellular routers and Industrial cellular modems have dual watchdogs, including software watchdogs and hardware watchdogs. They will wake up intelligently when the terminals are in trouble or restart automatically. Ensuring smooth wireless networking and wireless data transmission in real-time.
Software watchdog includes a process of kicking the dog or servicing the dog. The dog feeding process performs the dog feeding operation on a certain period, which is less than or equal to the period of the timer. Specifically, when the system is working normally, every once in a while output a signal to the dog feeding end, to reset the timer; If the dog is not fed beyond the specified time and the timer times out, a reset signal will be output to the system to reset the system to prevent the system from crashing.
The hardware watchdog is not restricted by the software. When the device is powered on, it can rely on the high pulse provided by the pull-up resistor to start the watchdog. As long as the software does not feed the dog in time, it will be reset, which is unconditional. The so-called "you get what you pay for" is also applicable to electronic products.
The main difference between software and hardware watchdog lies in the timing of opening the watchdog. Software watchdog must be initialized (configured) before it can be used. If the software watchdog is an API interface in the SDK provided by the manufacturer, the developer has no ability to modify the underlying uboot and kernel, and can not open and feed the dog in the uboot and kernel stage, The time to open the watchdog is very late, the program may not run to the watchdog initialization on the hang, in the middle are not controlled.
- +1 Like
- Add to Favorites
Recommend
- What is the Appropriate Speed and The Typical Power for Industrial Cellular Routers?
- Standards and Functions of Industrial Cellular Routers
- What Are the Factors That Affect the Signal of Industrial Cellular Routers?
- The Difference Between Industrial Routers and Home Routers
- Reasons for Good Wall Penetration Performance of 5G Cellular Routers
- Why Enterprises Choose 4G cellular routers?
- The Distinguishing Differences Between 4G LTE Routers and Industrial 4G Routers
- The Core Role and Application Examples of Cellular Routers
This document is provided by Sekorm Platform for VIP exclusive service. The copyright is owned by Sekorm. Without authorization, any medias, websites or individual are not allowed to reprint. When authorizing the reprint, the link of www.sekorm.com must be indicated.