ENDAT-D2550 USERS MANUAL
UNICORN COMPUTER CORP.
18
Sample code
(using TurboC/C++ 3.0):
#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(0x2e,0x87); //Unlock register
outportb(0x2e,0x87); //Unlock register
outportb(0x2e,0x07); //set Logic Device number pointer
outportb(0x2f,0x08); //set Logic Device number
outportb(0x2e,0x30); //set WDTO active
outportb(0x2f,0x01); //set reg value active (bit0 =1 active,0 inactive )
outportb(0x2e,0xf5); //set WDTO Control Mode
outportb(0x2f,0x04); //set register value (bit3=1: minute. =0: second)
outportb(0x2e,0xf6); //set WDT Counter
outportb(0x2f,tt);
//set time out value of WDT
}
void show_ver()
{
unsigned
char
tmp0;
printf("Designed by attila of UNICORN computer corp. \n2012/08/29 release
version:1.0a\n");
printf("This program is design for test Watch Dog Timer for ENADT-D2550
(W83627UHG).\n");
}