Watchdog Timer Sample Code - Quanmax KEMX-1600 Series User Manual

Industrial motherboard in mini-itx form factor with dual core intel atom processor d2550
Table of Contents

Advertisement

WatchDog Timer Sample Code

//============================================
//KEMX-1600 DOS Watchdog sample program
//Please compile with Turbo C 3.0 to utilized the program
//============================================
#include<stdio.h>
int main()
{
int value;
//Enter the MB PnP Mode
outp(0x2E,0x87);
outp(0x2E,0x01);
outp(0x2E,0x55);
outp(0x2E,0x55);
//Setting Logical Device Number to 0x07
outp(0x2E,0x07);
outp(0x2F,0x07);
//Set Timer unit
//(0x72 bit7(0: Minute, 1: Secont) of watchdog timer by setting this bit)
outp(0x2E,0x72);
value = inp(0x2F) & 0x5F;
value = value | 0x80;//set unit sec.
outp(0x2F,value);
//Set WDT output through KRST
//(0x72 bit6(1: Enable, 0: Disable))
outp(0x2E,0x72);
value = inp(0x2F) & 0xBF;
value = value | 0x40;//Enable WDT output
outp(0x2F,value);
//Set Timer Value
//(0x73 Time of watchdog timer)
outp(0x2E,0x73);
outp(0x2F,0x14);//set to 20 sec (0x14)
KEMX-1600 series User's Manual
Appendix B
73
Appendix B

Advertisement

Table of Contents
loading

Table of Contents