![AXIOMTEK E38M561100 User Manual Download Page 54](http://html.mh-extra.com/html/axiomtek/e38m561100/e38m561100_user-manual_3037518054.webp)
MANO561 Mini ITX Motherboard
48
Watchdog Timer
Appendix A
Watchdog Timer
A.1
About Watchdog Timer
Software stability is major issue in most application. Some embedded systems are not watched
by human for 24 hours. It is usually too slow to wait for someone to reboot when computer
hangs. The systems need to be able to reset automatically when things go wrong. The
watchdog timer gives us solution.
The watchdog timer is a counter that triggers a system reset when it counts down to zero from
a preset value. The software starts counter with an initial value and must reset it periodically. If
the counter ever reaches zero which means the software has crashed, the system will reboot.
A.2
Sample Program
#include
"stdafx.h"
#include
<windows.h>
#include
<stdio.h>
#include
<tchar.h>
#include
<stdlib.h>
#ifdef
_DEBUG
#define
new
DEBUG_NEW
#endif
#pragma
comment
(
lib
,
"User32.lib"
)
#define
IDT_TIMER
WM_USER
+ 200
#define
_CRT_SECURE_NO_WARNINGS
1
#define
setbit
(value,x) (value |=(1<<x))
#define
clrbit
(value,x) (value &=~(1<<x))
HINSTANCE
hinstLibDLL =
NULL
;
LONG
WDTDATA = 0;
typedef
ULONG
(*
LPFNDLLGETIOSPACE
)(
ULONG
);
LPFNDLLGETIOSPACE
lpFnDll_Get_IO;
typedef
void
(*
LPFNDLLSETIOSPACE
)(
ULONG
,
ULONG
);
LPFNDLLSETIOSPACE
lpFnDll_Set_IO;
int
_tmain
(
int
argc
,
_TCHAR
*
argv
[])
{
int
unit = 0;
int
WDTtimer = 0;
if
(hinstLibDLL ==
NULL
)
{
hinstLibDLL =
LoadLibrary
(
TEXT
(
"diodll.dll"
));
if
(hinstLibDLL ==
NULL
)
{
//MessageBox("Load diodll dll error", "", MB_OK);
}
}
if
(hinstLibDLL)
Summary of Contents for E38M561100
Page 5: ...v This page is intentionally left blank ...
Page 6: ......
Page 10: ...MANO561 Mini ITX Motherboard 4 Introduction 1 4 Block Diagram ...
Page 12: ...MANO561 Mini ITX Motherboard 6 Board and Pin Assignments Bottom View ...
Page 59: ...MANO561 Mini ITX Motherboard Digital I O 53 This page is intentionally left blank ...