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 TPC-1260 manual Watchdog timer programming example, Clear the watchdog timer