Appendix B Watchdog Timer Sample Code - Quanmax KUBE-8040 User Manual

Embedded box pc with intel core 2 duo processor
Table of Contents

Advertisement

WatchDog Timer Sample Code
//==========================================================
// The Watchdog Timer sample code in C format.
// User could user Turbo C 3.0 to compile the code .
//==========================================================
int main()
{
//Initialized the WDT program
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 Value(0x73 is LSB while 0x74 is MSB)
outp(0x2e,0x73);
outp(0x2f,0x14);//set to 20 sec (0x14)
//Set Timer Unit to Second/Minute(Bit 7 equal to 1 is second/0 is minute)
//Enable WDT (Bit 6 equal to 1 is enable/0 is disable)
outp(0x2e,0x72);
outp(0x2f,0xc0);//The unit is set as second
return 0;
}
KUBE-8040 User's Manual
Appendix B
41

Advertisement

Table of Contents
loading

Table of Contents