3 software watchdog mode, 4 bus monitor mode – Intel 386 User Manual

Page 500

Advertising
background image

17-5

WATCHDOG TIMER UNIT

17.2.3 Software Watchdog Mode

In software watchdog mode, system software must periodically reload the down-counter with a
reload value or the timer expires and asserts WDTOUT. The reload value depends on the design
of the system software. In general, determining the proper reload value requires software analysis
and some experimentation.

After reset, the WDT defaults to general-purpose timer mode. Unless you intervene, the WDT
times out after 4 million (2

22

) processor clock cycles. If you want to use the WDT as a system

watchdog, use this sequence to enable watchdog mode:

1.

Write the upper 16 bits of the reload value to WDTRLDH (Figure 17-4).

2.

Write the lower 16 bits of the reload value to WDTRLDL (Figure 17-4).

3.

Write two sequential words, 0F01EH followed by 0FE1H, to the WDTCLR location
(0F4C8H). This sequence (called a lockout sequence) sets the WDTEN bit in the
watchdog status register and loads the contents of the reload value register into the down-
counter.

Regardless of the values of the two control bits (BUSMON and CLKDIS) in the WDTSTATUS
register (Figure 17-3), the lockout sequence sets the WDTEN bit and clears the remaining bits.
The lockout sequence prohibits writes to the WDTSTATUS and reload registers; only a system
reset can change them. This reduces the possibility for errant software to duplicate the instruc-
tions and illegally reload the timer.

The same lockout sequence that enables the watchdog reloads the down-counter. Write two se-
quential words, 0F01EH followed immediately by 0FE1H, to the WDTCLR location (0F4C8H).

17.2.4 Bus Monitor Mode

In bus monitor mode, ADS# reloads and starts the down-counter and READY# stops it. The ini-
tial values of the reload register and down-counter are 3FFFFFH.

CAUTION

For correct operation in Bus Monitor mode (see “Overview” on page 17-1),
you must have a minimum reload value = (Maximum number of wait-states in
your system + 12). For example, if the slowest device in your system requires
8 wait-states during an access, the reload value must be greater than or equal to
20.

Use this sequence to enable bus monitor mode:

1.

Write the upper word of the reload value to WDTRLDH (Figure 17-4).

2.

Write the lower word of the reload value to WDTRLDL (Figure 17-4).

3.

Set the bus monitor bit (BUSMON) in WDTSTATUS (Figure 17-3).

Because you never execute the lockout sequence in bus monitor mode, you can change the reload
value and enable or disable the mode at any time.

Advertising