TIMERS and TIMER/COUNTERS KS57C2308/P2308/C2316/P2316
11-22
WATCH TIMER
OVERVIEW
The watch timer is a multi-purpose timer which consists of three basic components:
8-bit watch timer mode register (WMOD)
Clock selector
Frequency divider circuit
Watch timer functions include real-time and watch-time measurement and interval timing for the main and
subsystem clock. It is also used as a clock source for the LCD controller and for generating buzzer (BUZ) output.
Real-Time and Watch-Time Measurement
To start watch timer operation, set bit 2 of the watch timer mode register (WMOD.2) to logic one. The watch
timer starts, the interrupt request flag IRQW is automatically set to logic one, and interrupt requests commence
in 0.5-second intervals.
Since the watch timer functions as a quasi-interrupt instead of a vectored interrupt, the IRQW flag should be
cleared to logic zero by program software as soon as a requested interrupt service routine has been executed.
Using a System or Subsystem Clock Source
The watch timer can generate interrupts based on the system clock frequency or on the subsystem clock. When
the zero bit of the WMOD register is set to "1", the watch timer uses the subsystem clock signal (fxt) as its
source; if WMOD.0 = "0", the system clock (fxx) is used as the signal source, according to the following formula:
Watch timer clock (fw) = System clock (fxx)
128 = 32.768 kHz (fxx = 4.19 MHz)
This feature is useful for controlling timer-related operations during stop mode. When stop mode is engaged, the
main system clock (fx) is halted, but the subsystem clock continues to oscillate. By using the subsystem clock as
the oscillation source during stop mode, the watch timer can set the interrupt request flag IRQW to "1", thereby
releasing stop mode.
Clock Source Generation for LCD Controller
The watch timer supplies the clock frequency for the LCD controller (fLCD). Therefore, if the watch timer is
disabled, the LCD controller does not operate.