Chapter 12 watchdog timer – Remote Processing RPC-2350 User Manual

Page 55

Advertising
background image

CHAPTER 12

WATCHDOG TIMER

12-1

Figure 11-1 Watchdog timer jumper

CHAPTER SYNOPSIS

Ž

Uses for a watchdog timer

Ž

Cautions using watchdog

DESCRIPTION

WAT CHD OG TIM ER CH APTE R 12

A watchdog timer is used to reset the RPC -2350 if the
program or C PU "cr ashes". When enabled, the program
must write to I/O addr ess &E8 to avoid a reset. T he
timeout is adjustable for 150 ms, 600 ms, or 1.2
seconds.

T h e wa t ch d og s ho u ld b e d is a bl e d w h e n u s in g IN P U T
statements. Also, loops which do not end quickly or are
of indeterminate du ration should be avoided unless a
timer reset pulse is included. An example of an
indeterminate loop is one that waits for a port condition
to change.

The watchdog is enabled by writing a 1 to address &E4,
bit 0 and disabled by writing a 0 to the same location.
T h e t im e r is r es et by a ny a cc e ss (r e ad o r w r it e) to I/ O
address &E8.

The A IN com mand, in conjunction w ith the SPI po rt,
access this address. Thus, executing either an AIN or
SPI function also resets the watchdog timer, if enabled.

The watchdog timer is part of a voltage monitor and
reset chip U14.

Watchdog time is determined by jumper W 1. U se the
following tab le to set a timeo ut.

W1 Pins

Typical

timeout

Range

[1-2]

1.2 sec.

500 mS to 2 Sec.

no jumper

6 0 0 m s

2 5 0 m S to 1 00 0 m S

2-3

1 5 0 m s

6 2 . 5 t o 2 5 0 m S

WARNING:

Once the watchdog timer is enabled, it can only be
disabled by a BIT &E4, 0,0 in the program . If the
watchdog timer is running and the program stops for
any reason (program error or < Esc> key hit), the
card will reset. Y ou can recover the progr am by
t yp in g UN N E W .

PROGRAM EXAMPLES

The following program fragments enable the watchdog
timer, reset it while the program is running, and then
disables it.

100 OUT &E4,1 :'Turn on watchdog
.
.
.
5000 OUT &E8,0 :'Reset timer
7000 A = AIN(N) :’Reset timer
.
.
.
10000 OUT &E4,0 :'Turn off watchdog

Advertising