Products
IoT Gateways
Netcom Products
IoT Modules
PUSR CLoud
ODM/EMS
PCB Design —— ODM/EMS We provide one-stop turnkey design service to help customers with the delivery of an out-of-the-box hardware platform that is fully tested and ready to use upon delivery.
10
+ years of experience
11 high-speed SMT
10 million pcs daily
200
+ Private Cloud project
ISO9001 cert.
Intelligent MES
LEARN MORE
May 16, 2023 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 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 have an input, called feed the dog, an output to the MCU RST end,MCU normal work, 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 watch dog 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 in 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 51 series. We know that there are two timers in 51 microcontroller, 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 is 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 monitor T1, T1 monitor the main program, the main program to monitor 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 software does not.

  2) Shielding method: Software watchdog is easy to mask off, only need to modify the register, and 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 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 watch dogs, including software watch dogs and hardware watch dogs. 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 kicking the dog or service 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 in 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.

REQUEST A QUOTE
Copyright © Jinan USR IOT Technology Limited All Rights Reserved. 鲁ICP备16015649号-5/ Sitemap / Privacy Policy
Reliable products and services around you !
Subscribe
Copyright © Jinan USR IOT Technology Limited All Rights Reserved. 鲁ICP备16015649号-5Privacy Policy