Specifications
~ Page 24 ~
3-3-1. Watchdog Timers Setting
The watchdog timer is a circuit that may be used from your program software to detect system crashes or
hang-ups. Whenever the watchdog timer is enabled, the LED will blink to indicate that the timer is counting.
The watchdog timer is automatically disabled after reset.
Once you have enabled the watchdog timer, your program must trigger the watchdog timer every time
before it times out. After you trigger the watchdog timer, it will be set to non-zero value to watchdog counter
and start to count down again. If your program fails to trigger the watchdog timer before time-out, it will
generate a reset pulse to reset the system.
The factor of the watchdog timer time-out constant is approximately 1 minutes. The period for the watchdog
timer time-out is between 1 to FF timer factors.
If you want to reset your system when watchdog times out, the following table listed the relation of timer
factors between time-out periods. The formula of Time-Out Period is 30+60x(Time Factor -1). For example,
if the time factor is 10. The Time-out period is calculated as 30+60x(10-1)= 570.
Time Factor Time-out Period (Seconds)
1 30
2 90
3 150
4 210
5 270
“ “
“ “
“ “
FF “
Time out setting
3-3-2. Watchdog Timer Enabled
To enable the watchdog timer, you have to output a byte of timer factor to the watchdog. The following is a
Turbo C++ program, which demonstrates how to enable the watchdog timer and set the time-out period at 1
minute.
#include “studio.h”
#include “watchdog.h”
main( )
{
char WD_TIME=0x01;
print (“Enable watchdog” );
//Set watchdog Timer Output is 30 seconds
_enable_wd (WD_TIME);
}