
S1C88409 TECHNICAL MANUAL
EPSON
111
CHAPTER 5: PERIPHERAL CIRCUITS AND OPERATION (16-bit Programmable Timer)
5.12.3 Setting of input clock
The clock to be input to the counter can be selected
from either the internal clock or external clock by
the input clock selection register (CKSEL) pro-
vided for each timer. The internal clock is an
output of the prescaler. The external clock is used
for the event counter function. A signal from the
input port is used as the count clock.
Table 5.12.3.1 shows the input clock selection
register and input clock of each timer.
Table 5.12.3.1 Input clock selection
Timer
Timer 0
Timer 1
Register setting
CKSEL0 = "0"
CKSEL0 = "1"
CKSEL1 = "0"
CKSEL1 = "1"
Input clock
INCL00 (Prescaler)
EXCL00 (K10 input)
INCL01 (Prescaler)
EXCL01 (K11 input)
When the internal clock is used, the clock fre-
quency is set by selecting a source clock and a
division ratio of the prescaler.
When the external clock is selected, a signal from
the input port is directly input to the program-
mable timer.
However, it is necessary to control the output from
the clock control circuit and to input the internal
clock and external clock to the timers.
Refer to Section 5.5, "Prescaler and Clock Control
Circuit for Peripheral Circuits", for selection of the
division ratio and clock output control.
When the 16-bit mode is selected, the program-
mable timer operates with the clock input to Timer
0, and Timer 1 inputs the Timer 0 underflow signal
as the clock. Therefore, the setting of Timer 1 input
clock is invalid.
5.12.4 Operation and control of timer
Reload data register and setting
of initial value
The reload data register (RDR) is used to set an
initial value of the down counter.
In the 8-bit mode, it is used as two 8-bit registers
RDR0 (Timer 0) and RDR1 (Timer 1) separate for
each timer.
In the 16-bit mode, the RDR0 register is handled as
low-order 8 bits of reload data, and the RDR1
register is as high-order 8 bits.
The reload data register can be read and written,
and both the RDR0 and RDR1 registers are set to
FFH at initial reset.
Data written in this register is loaded into the
down counter, and a down counting starts from
the value.
The preset to down counter is done in the follow-
ing two cases:
1) When software presets
The software preset can be done using the
preset control bits PSET0 (Timer 0) and PSET1
(Timer 1). When the preset control bit is set to
"1", the content of the reload data register is
loaded into the down counter at that point.
In the 16-bit mode, a 16-bit reload data is
loaded all at one time by setting PSET0. In this
case, writing to PSET1 is invalid.
2) When down counter has underflowed during a count
Since the down counter presets the reload data
by the underflow, the underflow period is
decided according to the value set in the reload
data register. This underflow generates an
interrupt, and controls the clock (TOUT signal)
output.