beautypg.com

5 explanation of operation of watch timer, Explanation of operation of watch timer – FUJITSU F2MCTM-16LX User Manual

Page 292

background image

276

CHAPTER 15 WATCH TIMER

15.5

Explanation of Operation of Watch Timer

The watch timer operates as an interval timer or an oscillation stabilization wait time
timer of subclock. It also supplies an operation clock to the watchdog timer.

Watch Timer Counter

The watch timer counter continues incrementing in synchronization with the subclock (SCLK) while the

subclock (SCLK) is operating.

Clearing watch timer counter

The watch timer counter is cleared to "0000

H

" when:

A power-on reset occurs.

The mode transits to the stop mode.

The watch timer clear bit (WTR) in the watch timer control register (WTC) is set to "0".

Note:

When the watch timer counter is cleared, the interrupts of the watchdog timer and interval timer that use
the output of the watch timer counter are affected.
To clear the watch timer by writing zero to the watch timer clear bit (WTR) in the watch timer control
register (WTC), set the overflow interrupt enable bit (WTIE) in the WTC register to "0" and set the watch
timer to interrupt inhibited state. Before permitting an interrupt, clear the interrupt request issued by
writing zero to the overflow flag bit (WTOF) in the WTC register.

Interval Timer Function

The watch timer can be used as an interval timer by generating an interrupt at each interval time.

Settings when using watch timer as interval timer

Operating the watch timer as an interval timer requires the settings shown in Figure 15.5-1 .

Figure 15.5-1 Setting of Watch Timer

When the value set by the interval time select bits (WTC1, WTC0) in the watch timer control register

(WTC) is reached, the overflow flag bit in the WTC register is set to "1" (WTC:WTOF = 1).

When the overflow flag bit is set (WTC:WTOF = 1) with the overflow interrupt of the watch timer

counter enabled (WTC:WTIE = 1), an interrupt request is generated.

The overflow flag bit (WTC:WTOF) is set when the interval time is reached at the starting point of the

timing at which the watch timer is finally cleared.

WTC

6

5

4

3

2

1

WTOF WTR

WTC1

WTC2

SCE WTIE

WTC0

WDCS

bit7

bit0

: Used bit
: Unused bit