18
The ENDAT-4052i/M System Board
Program Sample
#include <stdio.h>
#include <dos.h>
#include <dir.h>
void show_ver();
void main()
{
unsigned
int
tt;
clrscr();
show_ver();
tt=0;
while((tt==0)||(tt>255))
{
printf("\n\nPlease key in how many seconds you want to reset system
(1~255):");
scanf("%d",&tt);
}
outportb(0x4e,0x87);
//Unlock
register
outportb(0x4e,0x87);
//Unlock
register
outportb(0x4e,0x07); //Set Logic Device number pointer
outportb(0x4f,0x08);
//Set Logic Device number
outportb(0x4e,0xf5);
//Set active register is CRF5
outportb(0x4f,0x00);
//Set
register
value (bit3=1: minute. =0: second)
outportb(0x4e,0xf7);
//Set active register is CRF7
outportb(0x4f,0x00);
//Disable all WDT interrupt (bit7=Mouse,
bit6=Keyboard)
outportb(0x4e,0xf6); //Set active register is CRF6
outportb(0x4f,tt); //Set time out value of WDT
}
void show_ver()
{
unsigned
char
tmp0;
printf("Designed by ROBERT LIOU of UNICORN computer corp.
\n2004/03/02 release version:1.0a\n");
printf("This program is design for test Watchdog Timer for W83627.\n");
}