Appendix B
68
KEMB-8100 & ATX-KLS0 Series User’s Manual
Appendix B
WatchDog Timer Sample Code
//==========================================================
==========//
//KEMB-8100 DOS Watchdog sample program
//
//Please compile with Turbo C 3.0 to utilized the program //
//==========================================================
==========//
#include<stdio.h>
#define SIO_CONFIG_INDEX 0x2e
#define SIO_CONFIG_DATA SIO_CONFI1
void UnlockSIO()
{
outp(SIO_CONFIG_INDEX,0x87);
outp(SIO_CONFIG_INDEX,0x87);
}
void LockSIO()
{
outp(SIO_CONFIG_INDEX,0xAA);
}
void SetLDN(int LDN)
{
outp(SIO_CONFIG_INDEX, 0x07);
outp(SIO_CONFIG_DATA, LDN);
}
void main()
{
int value = 0;
UnlockSIO();
SetLDN(0x08);
//Enable WDT
outp(SIO_CONFIG_INDEX,0x30);