
124
EPSON
S1C88409 TECHNICAL MANUAL
CHAPTER 5: PERIPHERAL CIRCUITS AND OPERATION (8-bit Programmable Timer)
5.13.3 Operation and control of timer
Reload data register and setting of
initial value
The reload data register RLD is used to set the
initial value of the down counter.
The reload data register can be read and written,
and is set to FFH at initial reset.
Data written in this register is loaded into the
down counter, and down counting starts from the
value. A preset to down counter is done in the
following two cases:
1) When software presets
The software preset can be done using the
preset control bit PSET. 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.
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 output to the
serial interface.
Timer operation
The 8-bit programmable timer is equipped with
the register PRUN which control the RUN/STOP
of the timer. The programmable timer starts down
counting by writing "1" to the PRUN register.
However, it is necessary to control the input clock
and to preset the reload data before starting a
count.
When "0" is written to the PRUN register, clock
input is prohibited, and the count stops.
This RUN/STOP control does not affect data in the
counter. The data in the counter is maintained
during count deactivation, so it is possible to
resume counting from the data.
The counter data can be read via the buffer PTD in
optional timing.
When the counter underflows, an underflow
interrupt is generated, and the initial value set in
the reload data register is loaded to the counter.
This underflow signal controls supplying the clock
to the serial interface.
PRUN
PSET
RLD
Input clock
PTD7
PTD6
PTD5
PTD4
PTD3
PTD2
PTD1
PTD0
A6H
F3H
Preset
Reload &
Interrupt generation
Fig. 5.13.3.1 Operation timing of counter