|
|||||
June 5, 1997 Watchdog timer reboots PCsCharles Hamilton, Burr-Brown Corp, Tucson, AZ When you use a PC to control a process or collect data, it's often desirable to have a watchdog timer reboot the computer if it runs astray. The circuit in Figure 1 uses a PIC16C84 µC to provide the watchdog function. The µC watches for pulses from the host; if the µC doesn't receive one within the prescribed period, it resets the host. The PIC16C84 contains its own watchdog timer, independent of the controller's clock. The host has no connection to the watchdog timer other than the pulse input, so the host cannot accidentally reprogram any delay times. You can program the delay times from less than milliseconds to days by changing the program in the µC. The host, reading from an I/O address, generates the pulse. You must write this address into the program running on the host. If you want to run other programs that do not have this code, you must disconnect the watchdog timer. To make the host start the target program upon reboot, include the program in the autoexec.bat file. Because the read strobe might be too short for the µC to detect reliably, a flip-flop in the GAL16V8 stretches the pulses. The PLD also decodes the host address, read, and address-enable lines. Upon power-up, the watchdog timer first waits for the host to boot up. In the configuration shown here, this wait interval is 3 minutes to allow time for the host to copy files. The timer then becomes active and begins watching for pulses from the host. If the timer doesn't receive a pulse in the programmed time-out period, the timer activates the relay for 200 msec. The relay has one set of contacts connected to the reset connection on the host's motherboard. Another set of contacts is available for warning indicators or to turn off equipment. By connecting the reset switch on the front of the PC to the test connection in the watchdog timer, you can test the timer. Hold the reset switch for the time-out period; the host should reboot and restart the host program. Listings 1 and 2 give the CUPL file for the GAL16V8 and the assembler source code for the PIC16C84, respectively. Click here to download the files from DI-SIG, #2037. (DI #2037) |
|||||
|
|||||
|
|||||
| EDN Access | Feedback | Table of Contents | |
|||||
| Copyright © 1997 EDN Magazine, EDN Access. EDN is a registered trademark of Reed Properties Inc, used under license. EDN is published by Cahners Publishing Company, a unit of Reed Elsevier Inc. | |||||