78
EPSON
E0C88832/88862 TECHNICAL MANUAL
5 PERIPHERAL CIRCUITS AND THEIR OPERATION (Programmable Timer)
Fig. 5.10.2.1 Basic operation timing of the counter
Fig. 5.10.2.2 Continuous mode and one-shot mode
■
Continuous/one-shot mode setting
By writing "1" to the continuous/one-shot mode
selection registers CONT0 (timer 0) and CONT1
(timer 1), the programmable timer is set to the
continuous mode. In the continuous mode, the
initial counter value is automatically loaded when
an underflow is generated, and counting is contin-
ued. This mode is suitable when programmable
intervals are necessary (such as an interrupt and a
synchronous clock for the serial interface).
On the other hand, when writing "0" to the registers
CONT0 (timer 0) and CONT1 (timer 1), the pro-
grammable timer is set to the one-shot mode. The
counter loads an initial value and stops when an
underflow is generated. At this time, the RUN/
STOP control register PRUN0 (timer 0) and PRUN1
(timer 1) are automatically reset to "0". After the
counter stops, a one-shot count can be performed
once again by writing "1" to registers PRUN0 (timer
0) and PRUN1 (timer 1). This mode is suitable for
single time measurement, for example.
The registers PRUN0 (timer 0) and PRUN1 (timer 1)
are provided to control the RUN/STOP for timers 0
and 1.
After the reload data has been preset into the
counter, down-counting is begun by writing "1" to
this register. When "0" is written, the clock input is
prohibited and the count stops.
The control of this RUN/STOP has no affect on the
counter data. The counter data is maintained even
during the stoppage of the counter and it can start
the count, continuing from that data.
The reading of the counter data can be done
through the data buffers PTD00–PTD07 (timer 0)
and PTD10–PTD17 (timer 1) with optional timing.
When the down-counting has progressed and an
underflow is generated, the counter reloads the
initial value set in the reload data register.
This underflow signal controls an interrupt genera-
tion, pulse (TOUT signal) output and serial inter-
face clocking, in addition to reloading the counter.
PRUN0(1)
PSET0(1)
RLD00–07(10–17)
Input clock
PTD07(17)
PTD06(16)
PTD05(15)
PTD04(14)
PTD03(13)
PTD02(12)
PTD01(11)
PTD00(10)
A6H
F3H
Preset
Reload and
interrupt generation
Input clock
Underflow
Continuous
mode
One-shot
mode
03H 02H 01H 00H A6H A5H A4H
03H 02H 01H 00H
A6H
Count
data
When "A6H" is set into reload data register RLD.
Содержание 0C88832
Страница 6: ......