![]() In Figure 4, a reset is generated after the watchdog counter reaches the timeout. This figure shows a typical program flow with the WDI signal generated within the main loop.įigure 3 shows the watchdog and reset signal for normal operation (watchdog is cleared within timeout period). Therefore, the designer normally chooses a watchdog timeout that is much longer than the longest measured or calculated loop time.įigure 2. ![]() Calculating the time it takes to execute the main loop is often difficult, as numerous subroutines might be called, depending on the inputs to the system. If the watchdog is not cleared, a reset occurs and the software branches to address 0000 (startup routine). The command to clear the watchdog counter must occur within the main program loop (Figure 2). The microprocessor clears the watchdog timer with a pulse on the WDI pin to prevent a reset. The WDI pin is connected to a processor I/O pin, which is toggled by the software (Figure 1).įigure 1. Therefore, either a rising or a falling edge on the watchdog input (WDI) will clear the counter. If clearing does not occur, the watchdog generates a reset to cause system reboot or creates a non-maskable interrupt (NMI), causing a program branch to a fault-recovery subroutine. The watchdog is a counter that must be cleared within the watchdog timeout period. A simple and effective method of achieving such improved system reliability is to use a watchdog. If a device recovers from an error without human intervention, the perceived quality of this device is good, as the user is unaware that something went wrong inside the device. Even if neither of these criteria apply, system crash/recovery without user intervention (pressing reset or power cycling) is preferred. This feature is critical for two main categories: systems that have high availability, such as servers, telephone systems, and production lines and systems that must be highly reliable because a crash could lead to injuries, as with automobiles, medical instruments, industrial control, robots, and automatic doors. However, for industrial control software, the system must be able to recover from code errors without human intervention. ![]() Therefore, designers must expect a minimum of 10 code errors in a typical control software program with 10,000 lines of code.ĭesktop application software errors that cause a system crash are not critical since the user can reboot the system with only a minor loss of data. While there is no such thing as a program without code errors, careful testing can reduce the number of errors to one to ten per 1000 lines of code. ![]() While software is often the lowest cost and most flexible way to solve a problem, it forces the designer to take extra measures to ensure system reliability. Many circuit functions previously realized with dedicated hardware are now implemented in software, due in part to today's broad choice of low-cost microprocessors (µPs). This document provides assistance in selecting the right time of watchdog/supervisory product for different type of applications and how to apply the circuit without the software code. Internal watchdog timers are subject to code execution problems, making external watchdog circuits invaluable in preventing system lockup. Watchdog timers are used to monitor and minimize code execution errors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |