The factor of the watchdog timer
If you want to reset your system when watchdog times out, the following table listed the relation of timer factors between
Time Factor |
| |
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
#Include “ stdio. H” #include “WATCHDOG.H” main( )
{
char WD_TIME=oxo1; printf (“ Enable watchdog” );
//Set watchdog Timer Output is 30 seconds _enable_wd (WD_TIME);
}
3-3-3. Watchdog Timer Trigger
After you enable the watchdog timer, your program must write the same factor as enabling to the watchdog register at least once every
#include “ stdio.H” #include “WATCHDOG.H” main( )
{
char WD_TIME=oxo1; printf (“ Trigger watchdog” );
//Set watchdog Timer Output is 30 seconds _enable_wd(WD_TIME);
}
~ Page 24 ~