What is a watchdog Is the watchdog important to industrial routers

Industrial-grade wireless router, as a very important device in wireless networking, has insight into customer application scenarios.

watchdog IoT industrial router gateway DTU

As long as it is related to the reliability of wireless networking, even the most subtle technical applications must be extreme, such as watchdog. Why do industrial-grade wireless routers attach so much importance to software and hardware watchdogs? Today we will take a look at the difference between software and hardware watchdogs.

The watchdog, also called watchdog timer, is a timer circuit. Generally, there is one input, called feeding the dog, and one output to the RST terminal of the MCU. When the MCU is working normally, it outputs a signal to the dog feeding terminal at regular intervals. Clear the WDT. If the dog is not fed for more than the specified time (usually when the program runs away), the WDT timing exceeds, and a reset signal will be sent to the MCU to reset the MCU. Prevent the MCU from crashing. The function of the watchdog is to prevent The program has an infinite loop or the program runs away.

Working principle: After the system is running, the watchdog counter is started, and the watchdog starts counting automatically. If the watchdog is not cleared after a certain period of time, the watchdog counter will overflow and cause the watchdog to count. The dog is interrupted, causing the system to reset. So when using a chip with a watchdog, pay attention to clear the watchdog.

The hardware watchdog uses a timer to monitor the running of the main program, that is to say, during the running of the main program, we need to reset the timer before the timer expires. If there is an infinite loop, or the PC pointer can't come back. Then when the timing time is up, the microcontroller will be reset.

The principle of software watchdog technology is similar to this, but it is realized by software. We still use the 51 series as an example. We know that there are two timers in the 51 single-chip microcomputer, and we can use these two timers to Monitor the operation of the main program. We can set a certain timing time for T0, and assign a value to a variable when a timing interrupt is generated, and this variable already has an initial value at the beginning of the main program running, and the timing value we want to set here should be less than The running time of the main program. In this way, the value of the variable is judged at the end of the main program. If the value changes as expected, it means that the T0 interrupt is normal. If there is no change, the program is reset.

For T1, we use it 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 within a certain period of time, the timing interrupt of T1 will make the microcontroller reset. Here, the timing time of T1 should be set greater than the running time of the main program, leaving a certain margin for the main program. Whether the interrupt of T1 is normal or not is monitored by the T0 timer interrupt subroutine. 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.

watchdog IoT industrial router gateway DTU

Jrepus communication industrial-grade wireless routers and industrial-grade wireless DTUs have dual watchdogs, including software watchdogs and hardware watchdogs. When the M2M terminal is abnormal occasionally, it will intelligently perform software wake-up or hardware power-off and automatically restart to ensure real-time wireless protection. Networking and wireless data transmission are unimpeded.

The software watchdog includes a process of kicking the dog or service the dog. The dog feeding process executes the dog feeding operation at a certain period, which is less than or equal to the period of the timer. Specifically, when the system is working normally, it outputs a signal to the dog feeding terminal every once in a while, and resets the timer; if the dog is not fed for more than the specified time, the timer times out, and a reset signal is output to the system, Reset the system to prevent the system from freezing.

SHARE:

Leave A Comment

Please note, comments must be approved before they are published