beautypg.com

2 watchdog timer enabled, 3 watchdog timer trigger, 4 watchdog timer disabled – SMC Networks 486DX4 User Manual

Page 50

background image

AR-B1462 User¡

¦s Guide

5-10

NOTE: 1. If you program the watchdog to generate IRQ15 signal when it times out, you should initial IRQ15

interrupt vector and enable the second interrupt controller (8259 PIC) in order to enable CPU to process
this interrupt. An interrupt service routine is required too.

2. Before you initial the interrupt vector of IRQ15 and enable the PIC, please enable the watchdog timer

previously, otherwise the watchdog timer will generate an interrupt at the time watchdog timer is
enabled.

I/O Port 214h
Factory-Default Setting

On

Off

1

4

3

2

SW1-1

On

Off

1

4

3

2

SW1-1

I/O Port 294h

5

6

7

8

9

10

5

6

7

8

9

10

Figure 5-1 SW1-1: Watchdog I/O Port Address Select

5.3.2 Watchdog Timer Enabled

To enable the watchdog timer, you have to output a byte of timer factor to the watchdog register whose address is
214H or Base Port. The following is a BASICA program which demonstrates how to enable the watchdog timer and
set the time-out period at 24 seconds.

1000

REM Points to command register

1010

WD_REG% = 214H

1020

REM Timer factor = 84H (or 0C4H)

1030

TIMER_FACTOR% = %H84

1040

REM Output factor to watchdog register

1050

OUT WD_REG%, TIMER_FACTOR%

.,etc.

5.3.3 Watchdog Timer Trigger

After you enable the watchdog timer, your program must write the same factor as enabling to the watchdog register
at least once every time-out period to its previous setting. You can change the time-out period by writing another
timer factor to the watchdog register at any time, and you must trigger the watchdog before the new time-out period
in next trigger. Below is a BASICA program which demonstrates how to trigger the watchdog timer:

2000

REM Points to command register

2010

WD_REG% = 214H

2020

REM Timer factor = 84H (or 0C4H)

2030

TIMER_FACTOR% = &H84

2040

REM Output factor to watchdog register

2050

OUT WD_REG%, TIMER_FACTOR%

.,etc.

5.3.4 Watchdog Timer Disabled

To disable the watchdog timer, simply write a 00H to the watchdog register.

3000

REM Points to command register

3010

WD_REG% = BASE_PORT%

3020

REM Timer factor = 0

3030

TIMER_FACTOR% = 0

3040

REM Output factor to watchdog register

3050

OUT WD_REG%, TIMER_FACTOR%

., etc.

This manual is related to the following products: