MANO540 Mini ITX Motherboard
Watchdog Timer
55
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);
}
}
Summary of Contents for MANO540 Series
Page 6: ...vi This page is intentionally left blank ...
Page 10: ...MANO540 Mini ITX Motherboard 4 Introduction 1 4 Block Diagram ...
Page 18: ...MANO540 Mini ITX Motherboard 12 Board and Pin Assignments 20 21 Bottom View ...
Page 66: ...MANO540 Mini ITX Motherboard 60 Digital I O This page is intentionally left blank ...