Advantech manual B.1 Watchdog timer programming example, clear the watchdog timer, for TPC-1260

Models: TPC-1260

1 74
Download 74 pages 53.49 Kb
Page 62
Image 62
B.1 Watchdog timer programming example

B.1 Watchdog timer programming example

The watchdog timer built in the TPC-1260 is a useful aid to reduce system down time-especially for those operating systems not reliable enough. There is a counter inside the watchdog timer. If the system does not constantly clear the counter within the timeout period, the watchdog timer would initialize a system reset.

The following example program in assembly language gives hint to utilize the watchdog timer under operating systems such as DOS, Windows 9x/NT, etc.

Step 1: activate the watchdog timer

mov dx, 404Ch

in

al, dx

 

and

al, NOT 80h

; GPO7 to low

out

dx, al

 

Step 2: clear the watchdog timer

 

mov

dx, 404Ch

 

in

al, dx

 

or

al, 80h

; GPO7 to high

out dx, al

Step 3: re-trigger the watchdog timer

If the timer will not count the GP07 is kept high. To re-trigger the watch- dog timer:

mov

dx, 404Ch

 

in

al, dx

 

and

al,

NOT 80h

; GPO7 to low

out

dx,

al

 

Notice:

the utility to enable/disable the watchdog timer under

 

Windows CE is built in the Advantech Windows CE

 

for TPC-1260.

5 4 TPC-1260 User's Manual

Page 62
Image 62
Advantech manual B.1 Watchdog timer programming example, clear the watchdog timer, for TPC-1260