MANO321 Mini ITX Motherboard
Watchdog Timer
53
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)
Содержание MANO321 Series
Страница 1: ...MANO321 Series Intel Celeron Processor J6412 Mini ITX Motherboard User s Manual ...
Страница 6: ...vi This page is intentionally left blank ...
Страница 10: ...MANO321 Mini ITX Motherboard 4 Introduction 1 4 Block Diagram ...
Страница 12: ...MANO321 Mini ITX Motherboard 6 Board and Pin Assignments Bottom View ...
Страница 35: ...MANO321 Mini ITX Motherboard AMI BIOS Setup Utility 29 CPU Configuration This screen shows CPU information ...