Cómo funciona la protección del perro guardián

Among the hardware protection measures, there is one that can make the internal process of the device not paralyzed for 24 hours, which is the watchdog technology. In order to make the transmission of industrial routers, DTUs, and other network devices more stable. These devices will be equipped with anti-surge, anti-static, anti-pulse, and watchdog protection. How does the watchdog protection work and calculate?

Watchdog chip, also called watchdog timer. It is a piece of hardware in a microcontroller. If the system gets stuck somewhere, then the watchdog timer is used to generate a system reset, and if the system gets into an infinite loop of execution, then the watchdog timer will reset the system to get out of the infinite loop. Watchdog is a safety mechanism in embedded systems that makes your system reliable, but it depends on how the watchdog timer is used.

Cómo funciona la protección del perro guardián

Cómo funciona la protección del perro guardián

Un watchdog es básicamente un contador que empieza a contar desde cero y alcanza un determinado valor. Si el contador alcanza un determinado valor, el hardware del watchdog generará un reinicio del watchdog. Para evitar el reinicio del sistema, el software debe iniciar el watchdog, lo que significa que el contador debe ponerse a cero. En caso de que el software se quede atascado en un bucle sin fin, el sistema no será capaz de poner en marcha el watchdog, por lo que el contador alcanza un cierto valor y reinicia el sistema.

The watchdog protection is initially loaded with certain values. This value is calculated based on the watchdog’s timeout (further instructions on how to calculate the counter value based on the timeout value are provided). Before timing out, the system should reset the counter.

Por ejemplo, si tu sistema ejecuta 3 tareas regularmente y tarda 500 milisegundos en ejecutar 3 tareas. Entonces considera el tiempo de espera como 600 ms (considerando el peor escenario), calcula el valor del contador para 600 ms y cárgalo en el watchdog.

Watchdog computing

Considera que el sistema en Watchdog está funcionando con un reloj de 4 kHz. El sistema completa el trabajo en 450 milisegundos, y en el peor de los casos, tarda 500 milisegundos en completar el trabajo. Usemos 500 milisegundos como tiempo de espera.

1/4 kHz = 0,25 milisegundos

1 tick de reloj = 0,25 milisegundos.

500 milisegundos = 2000 ticks.

Cuando el reloj hace tictac 2000 veces, completa 500 milisegundos. El valor técnico asociado al tiempo de espera es 2000.

Si el contador de vigilancia llega a 2000, generará una señal de reinicio. El sistema necesita reiniciar el contador a 0 antes de llegar a 2000.

Cómo funciona la protección del perro guardián

Casos de uso avanzados para temporizadores watchdog

In the case of operating systems (multitasking systems), watchdog plays an important role. Watchdogs can monitor program flow and monitor the frequency of task execution (activity supervision). A watchdog reset is generated if the watchdog detects a program flow conflict or if a task is executed too frequently or infrequently.

In the case of online supervision, each task has a flag set to indicate that the task is online, that is, executed. The watchdog monitor function will check whether each task has reported an active indication. If the task is not set to activate indication, the watchdog monitor function will never kick the watchdog and eventually the watchdog will reset the system.

Applications of Watchdog Protection

1. Embedded Systems

In embedded systems, watchdog protection is used to monitor the operation of microcontrollers. Since embedded devices often operate in unattended environments, any software failure or hardware error can lead to system crashes. The watchdog timer regularly checks the system’s responsiveness to ensure the device operates normally. If the device fails to send a signal on time, the watchdog will reset the system to restore functionality.

2. Industrial Automation

In industrial automation, equipment reliability is crucial, as downtime can result in significant financial losses. Watchdog protection ensures that devices on the production line can quickly recover from faults. For example, in robots and control systems, if software malfunctions occur, the watchdog can promptly restart the system, maintaining production efficiency and minimizing delays.

3. Telecommunications

In telecommunications networks, routers and switches need to operate continuously to ensure stable data flow. Watchdog protection can monitor the status of these devices and address potential failures in a timely manner. By resetting unresponsive devices, network administrators can reduce the risk of service interruptions and ensure high-quality connections for customers and overall network reliability.

4. Automotive Systems

Modern vehicles are equipped with numerous electronic control units (ECUs) responsible for critical functions such as braking, steering, and power systems. Watchdog protection is essential in these systems, ensuring that critical functions operate correctly under all circumstances. For instance, if the control software for the braking system malfunctions, the watchdog will immediately reset the control unit, ensuring the vehicle can continue to operate safely.

Resumen

Watchdog protection demonstrates its importance across various industries, enhancing system reliability and safety. By promptly monitoring and addressing faults, it provides reliable support for many industrial devices and automotive systems.

Palabras clave: 4gdtu

Artículos recientes

Póngase en contacto con nosotros