S1C88348/317/316/308 TECHNICAL HARDWARE
EPSON
I-103
5 PERIPHERAL CIRCUITS AND THEIR OPERATION (Programmable Timer)
5.11 Programmable Timer
5.11.1 Configuration of programmable timer
The S1C883xx has two built-in 8-bit programmable
timer systems (timer 0 and timer 1).
Timer 0 and timer 1 are composed of 8-bit
presettable down counters and they can be used as
8-bit
× 2 channels or 16-bit × 1 channel programma-
ble timer. They also have an event counter function
and a pulse width measurement function using the
K10 input port terminal.
Figure 5.11.1.1 shows the configuration of the
programmable timer.
Programmable setting of the transfer rate is possi-
ble, due to the fact that the programmable timer
underflow signal can be used as a synchronous
clock for the serial interface.
The underflow divided by 1/2 signal can also be
output externally from the R27 output port terminal.
5.11.2 Count operation and
setting basic mode
Here we will explain the basic operation and
setting of the programmable timer.
s Setting of initial value and counting down
The timers 0 and 1 each have a down counter and
reload data register.
The reload data registers RLD00–RLD07 (timer 0)
and RLD10–RLD17 (timer 1) are registers that set
the initial value of the counter.
By writing "1" to the preset control bit PSET0 (timer
0) or PSET1 (timer 1), the down counter loads the
initial value set in the reload register RLD.
Therefore, down-counting is executed from the
stored initial value according to the input clock.
Fig. 5.11.1.1 Configuration of programmable timer
Reload data register
RLD00–RLD07
Data buffer
PTD00–PTD07
Input port
K10
PRUN0
FCSEL
PLPOL
Programmable timer 0
PSC00
PSC01
Reload
signal
8-bit down counter
Prescaler
OSC3
oscillation
circuit
OSC1
oscillation
circuit
Selector
CKSEL0
Timer 0 Run/Stop
EVIN (K10)
RLMD0
PSET0
Clock
controller
Reload
controller
EVCNT
Event counter mode setting
Timer function setting
Pulse polarity setting
Prescaler
setting
Underflow
signal
Reload data register
RLD10–RLD17
Data buffer
PTD10–PTD17
MODE16
Programmable timer 1
PSC10
PSC11
Reload
signal
8-bit down counter
Prescaler
RLMD1
PSET1
Clock
controller
Reload
controller
8/16-bit mode
setting
Prescaler
setting
Underflow
signal
Data
bus
Interrupt
request
Interrupt
control
circuit
Output port
R27
TOUT (R27)
Serial
interface
PRUN1
Selector
CKSEL1
Timer 1 Run/Stop
fOSC1
fOSC3
Divider
2,048 Hz
Selector
CHSEL
1/2
PTOUT