Sample code shows as below
// Normal procedure
//===========================================================================
void Show_Title()
{
clrscr();
printf("WatchDog Test for ITE8712F\n");
printf("1. WDT.EXE 10 s ==--> 10 seconds to reset.\n");
printf("2. WDT.EXE 20 m ==--> 20 minutes to reset.\n");
}
//===========================================================================
// Main procedure
//===========================================================================
int main(int argc, char *argv[])
{
BYTE i,j;
char Time_Format;
BYTE IO_Port_Address=0x2E;
BYTE Time=10;
// Default is 10
BYTE Format=0x80;
// Default is 0x01 = Seconds
if ( argc != 3 )
{ Show_Title(); return 1; }
clrscr();
textcolor(BLINK);
Time=atoi(argv[1]);
Time_Format=argv[2][0];
if(Time_Format=='m' || Time_Format=='M')
Format=0x00; //
Minutes
if(Time_Format=='s' || Time_Format=='S')
Format=0x80; //
Seconds
// Set Watchdog
outportb(IO_Port_Address,0x87); // Enter configure
outportb(IO_Port_Address,0x01);
outportb(IO_Port_Address,0x55);
outportb(IO_Port_Address,0x55);
outportb(IO_Port_Address,0x07);
// Point to Logical Device Number Reg.
outportb(IO_Port_1,0x07); // Select logical device 7, (Watchdog Function)
outportb(IO_Port_Address,0x72);
// Select Watchdog use keyboard reset
outportb(IO_Port_1,0x40);
outportb(IO_Port_Address,0x72);
// Select Watchdog count mode seconds or minutes
outportb(IO_Port_1,Format|inportb(IO_Port_1));
outportb(IO_Port_Address,0x73);
// Set Watchdog Timer Value
outportb(IO_Port_1,Time); // 0x00 to disable, max 0xFF
i=Time;
j=i*60;
19
Summary of Contents for AR-B1572
Page 8: ...1 3 BLOCK DIAGRAM...