Appendix B
58
KEEX-6100 User’s Manual
Appendix B
WatchDog Timer Sample Code
//============================================
//KEEX-6100 DOS Watchdog sample program
//Please compile with Turbo C 3.0 to utilized the program
//============================================
#include<stdio.h>
int main()
{
int value;
//Initialized the WDT program
outp(0x2E,0x87);
outp(0x2E,0x87);
//Setting Logical Device Number to 0x07
outp(0x2E,0x07);
outp(0x2F,0x07);
//0xF5 bit6
//If watchdog timeout event occurs, this bit will be set to 1.
//Write a 1 to this bit will clear it to 0.
outp(0x2F,0xF5);
value=inp(0x2F);
outp(0x2F,(value | 0x40));
//Set Timer unit
//(0xF5 bit3(0: 1sec, 1: 60 sec) of watchdog timer by setting this bit)
outp(0x2E,0xF5);
value=inp(0x2F);
outp(0x2F,(value & 0xF7));//set unit sec.
//Set Timer Value(0xF6 Time of watchdog timer)
outp(0x2E,0xF6);
outp(0x2F,0x14);//set to 20 sec (0x14)
//Enable WDT
outp(0x2E,0xF5);
value=inp(0x2F);
outp(0x2F,(value | 0x30));//
Содержание KEEX-6100
Страница 19: ...Chapter 1 19 KEEX 6100 User s Manual System Block Diagram Figure 1 Block Diagram ...
Страница 20: ...Chapter 1 20 KEEX 6100 User s Manual Mechanical Dimensions ...
Страница 21: ...Chapter 1 21 KEEX 6100 User s Manual Figure 2 Mechanical Dimensions ...
Страница 59: ...Appendix B 59 KEEX 6100 User s Manual outp 0x2E 0xF0 outp 0x2F 0x81 bit7 WDTRST output is enabled return 0 ...