Panasonic F77G, MN101C77C user manual Setup Example

Models: F77G MN101C77C

1 544
Download 544 pages 59.61 Kb
Page 319
Image 319

Chapter 9 Watchdog Timer

9-3-2 Setup Example

The watchdog timer detects errors. On the following example, the watchdog timer period is set to 218 system clock, the lowest value for watchdog timer clear is set to 29 system clock.

An example setup procedure, with a description of each step is shown below.

„Initial Setup Program (Watchdog Timer Initial Setup Example)

 

Setup Procedure

 

Description

 

 

 

 

(1)

Set the time-out period.

(1)

Set the WDTS1-0 flag of the watchdog timer

 

WDCTR (x'03F02')

 

control register (WDCTR) to "01" to select the

 

bp2-1 : WDTS1-0 = 01

 

time-out period to 218 system clock.

(2)

Set the lowest value for clear.

(2)

Set the WDTC2-0 flag of the WDCTR register

 

WDCTR (x'03F02')

 

to "010" to select the lowest value for clear to

 

bp5-3 : WDTC2-0 = 010

 

29 system clock.

(3)

Start the watchdog timer operation.

(3)

Set the WDEN flag of the WDCTR register to

 

WDCTR (x'03F02')

 

start the watchdog timer operation.

 

bp0 : WDEN = 1

 

 

 

 

 

 

The command of setting the WDEN flag to "1" should be done on the last step of the initial setting. If the watchdog control register (WDCTR) is changed after starting the operation, the watchdog interrupt may be generated depending on the setting of the lowest value for clear.

„Main Routine Program (Watchdog Timer Constant Clear Setup Example)

Setup Procedure

Description

 

 

(1) Set the constant watchdog timer clear.

(1) Clear the watchdog timer by the cycle from 29

Writing to WDCTR (x'03F02')

system clock up to 218 system clock.

(cf.) BSET (WDCTR) WDEN

 

(bp0 : WDEN = 1)

The watchdog timer clear should be inserted in

 

the main routine, with the same cycle, and to

 

be the set cycle.

 

The recommended instruction is the bit-set

 

(BSET), does not change value, for clear.

 

 

Operation IX - 7

Page 319
Image 319
Panasonic F77G, MN101C77C user manual Setup Example