
A-4
GPIO WDT BKL Programming
MS-9A79
Watchdog Timer
2. Watchdog
Timer
–
WDT
The
base
address
(WDT_BASE)
of
WDT
configuration
registers
is
0xA10.
2.1
Set
WDT
Time
Unit
val
=
Inportb
(WDT_BASE
+
0x05);
//
Read
current
WDT
setting
val
=
val
|
0x08;
//
minute
mode.
val
=
val
&
0xF7
if
second
mode
Outportb
(WDT_BASE
+
0x05,
val);
//
Write
back
WDT
setting
2.2
Set
WDT
Time
Outportb
(WDT_BASE
+
0x06,
Time
);
//
Write
WDT
time,
value
1
to
255.
2.3
Enable
WDT
val
=
Inportb
(WDT_BASE
+
0x0A);
//
Read
current
WDT_PME
setting
val
=
val
|
0x01;
//
Enable
WDT
OUT:
WDOUT_EN
(bit
0)
set
to
1.
Outportb
(WDT_BASE
+
0x0A,
val);
//
Write
back
WDT
setting.
val
=
Inportb
(WDT_BASE
+
0x05);
//
Read
current
WDT
setting
val
=
val
|
0x20;
//
Enable
WDT
by
set
WD_EN
(bit
5)
to
1.
Outportb
(WDT_BASE
+
0x05,
val);
//
Write
back
WDT
setting.
2.4
Disable
WDT
val
=
Inportb
(WDT_BASE
+
0x05);
//
Read
current
WDT
setting
val
=
val
&
0xDF;
//
Disable
WDT
by
set
WD_EN
(bit
5)
to
0.
Outportb
(WDT_BASE
+
0x05,
val);
//
Write
back
WDT
setting.
2.5
Check
WDT
Reset
Flag
If
the
system
has
been
reset
by
WDT
function,
this
flag
will
set
to
1.
val
=
Inportb
(WDT_BASE
+
0x05);
//
Read
current
WDT
setting.
val
=
val
&
0x40;
//
Check
WDTMOUT_STS
(bit
6).
if
(val)
printf
(“timeout
event
occurred”);
else
printf
(“timeout
event
not
occurred”);
2.6
Clear
WDT
Reset
Flag
val
=
Inportb
(WDT_BASE
+
0x05);
//
Read
current
WDT
setting
val
=
val
|
0x40;
//
Set
1
to
WDTMOUT_STS
(bit
6);
Outportb
(WDT_BASE
+
0x05,
val);
//
Write
back
WDT
setting
Summary of Contents for 939-9A79-002
Page 1: ...i MS 9A79 Industrial Data Machine...
Page 8: ......
Page 22: ...1 14 Overview System Dimensions...
Page 23: ...1 15 MS 9A79 Mounting Brackets...
Page 24: ...1 16 Overview...
Page 31: ...2 7 MS 9A79 6 Connect the antenna cables...
Page 37: ...2 13 MS 9A79 8 Fasten the screws to secure the system cover...
Page 46: ......
Page 66: ......