ECM-3410/3410L/3410N
ECM-3410/3410L/3410N User’s Manual
109
void WriteAData(unsigned char reg, unsigned char data)
{
outportb(IO_INDEX_PORT, reg);
outportb(IO_DATA_PORT, data);
}
void SetWatchDogTime(unsigned char time_val)
{
EnterConfigMode();
SelectDevice(8);
//Set Register F2
//Set Watch-Dog Timer 1~ 256 steps
WriteAData(0xF2, time_val);
ExitConfigMode();
}
void main(int argc, char* argv[])
{
int time_value=0;
char *ptr;
printf("WinBond 83977F/AF WatchDog Timer Test Utility Version 1.0 \n");
printf("Copyright (C) 2000 Evalue Technology Inc.\n");
printf("(Support ECM-3410 only and the system will be reset)\n");
if (argc == 1)
{ printf("\n Syntax: 3410WD [step] \n");
printf(" step range : 1 ~ 256 steps \n");
printf(" timer range: 0:16 ~ 127:16 (min:sec) \n");
return ;
}
if (argc > 1)
{
ptr = argv[1];
time_value = atoi(ptr);
}
if (time_value > 0 && time_value < 256)
{
SetWatchDogTime((unsigned char) time_value);
printf("Watch Dog reset Timer set up : %02d:%02d ",(time_value-1)/2,
((time_value-1)%2)*30+16);
}
}