SYS-ITX-N-3900/Setup
v1.0
www.winsystems.com
Page 11
7.4
Watchdog Timer (WDT)
The SYS-ITX-N-3900 features an advanced watchdog timer (WDT) that can
be used to guard against software lockups. The timer is programmable
from 1 second to 255 minutes (15,300 seconds).
NOTE Use a long timeout if the watchdog timer is enabled and booting to an
operating system.
Use the following example as a guide to programming the WDT.
7.4.1 Example Code for WDT
The ITX-N-3900 features a programmable WDT. The following WDT code
example is written in C. Use this example as a guide to program the WDT.
Example C/C++ applications are available in the WDT System Management
package.
NOTE The WDT System Management package is available upon request
from WINSYSTEMS (see contact information in the Introduction section on
page 1).
The SYS-ITX-N-3900 features a programmable WDT. The following WDT
code example is written in C++. Use this example as a guide to program
the WDT.
##Define WDTCFG 0x06// WDT Timer Counter Register
#Define WDTMIN 0x07// WDT Timer Counter Register (Minute)
#Define WDTSEC 0x08// WDT Timer Counter Register (Second)
#Define EC_IOPort 0xE300// Default, reference to BIOS configuration
VOID Write_EC_SRAM(UINT8 Offset,UINT8 Value){
IoWrite8(ECOffset,Value);
}
Byte Read_EC_SRAM(UINT8 Offset){ IoRead8(ECoffset,Value);
return Value;
}
void WDT()
{
// Enable WDT 30sec Write_EC_SRAM(WDTSEC,30);
Write_EC_SRAM(WDTCFG,0x01);//Bit0: WDT Enable, BIT1: 0:Second Mode
// Enable WDT 5min Write_EC_SRAM(WDTSEC,5);
Write_EC_SRAM(WDTCFG,0x03);//Bit0: WDT Enable, BIT1: 1:Minute Mode
// Enable WDT 10min, 20sec Write_EC_SRAM(WDTSEC,20);
Write_EC_SRAM(WDTSEC,10);
Write_EC_SRAM(WDTCFG,0x03);//Bit0: WDT Enable, BIT1: 1:Minute Mode
}