TDS e28 User Manual - page 29
E28 User Manual
outportb(IO_Port_Address,0x87);
outportb(IO_Port_Address,0x87);
// Enter Configuration
outportb(IO_Port_Address,0x07);
outportb(IO_Port_Address+1,0x07);
// Point to Logical Device Number Reg.
// Select logical device 7, (Watchdog Function)
outportb(IO_Port_Address,0x30);
outportb(IO_Port_Address+1,0x01);
// Device Active register
outportb(IO_Port_Address,0xF5);
// Select Watchdog count mode seconds or minutes
outportb(IO_Port_Address+1,inportb(IO_Port_Address+1)&0xF7);
// Default is second, bit3=0
outportb(IO_Port_Address,0xF5);
// Select Watchdog output mode
outportb(IO_Port_Address+1,inportb(IO_Port_Address+1)|0x10);
// Set to Pulse mode, bit4=1
outportb(IO_Port_Address,0xF6);
outportb(IO_Port_Address+1,Time);
// Set Watchdog Timer Value
// 0x00 to disable, max 0xFF
outportb(IO_Port_Address,0xFA);
// Set Watchdog Time out output via WDTRST
outportb(IO_Port_Address+1,inportb(IO_Port_Address+1)|0x01); // bit0=1
outportb(IO_Port_Address,0xF5);
// Start Watchdog Time counting
outportb(IO_Port_Address+1,inportb(IO_Port_Address+1)|0x20); // bit5=1
textcolor(YELLOW);
for(Temp=Time;Temp>0;Temp--)
{ outportb(IO_Port_Address,0xF6);
Time=inportb(IO_Port_Address+1);
// Read Watchdog Timer Value
gotoxy(20,10);
cprintf(">>> After %3d Second will reset the system.
delay(1000);
}
textcolor(LIGHTRED);
gotoxy(18,10);
29