Setting Of Input Clock; Timer Mode - Epson 0C88832 Technical Manual

Cmos 8-bit single chip microcomputer
Table of Contents

Advertisement

8/16-bit mode setting
By writing "0" to the 8/16-bit mode selection
register MODE16, timer 0 and timer 1 are set as
independent timers in 8-bit × 2 channels. In this
mode, timer 0 and timer 1 can be controlled
individually and each of them operates independ-
ently.
On the other hand, when writing "1" to the register
MODE16, timer 0 and timer1 are set as 1 channel
16-bit timer. This is done by setting timer 0 to the
lower 8 bits, and timer 1 to the upper 8 bits. The
timer is controlled by timer 0's registers. In this
case, the control registers for timer 1 are invalid.
(PRUN1 is fixed at "0".)
[8-bit mode]
8-bit data
Timer 0
Interrupt
input
Timer 0
request
clock
Timer 1
Interrupt
input
Timer 1
request
clock
8-bit data
Fig. 5.10.2.3 8/16-bit mode setting and counter configuration

5.10.3 Setting of input clock

Prescalers have been provided for timers 0 and 1.
The prescalers generate the input clock for each by
dividing the source clock signal from the OSC1 or
OSC3 oscillation circuit.
The source clock and the dividing ratio of the
prescaler can be selected individually for timer 0
and timer 1 in software.
The input clocks are set by the below sequence.
(1) Selection of source clock
Select the source clock (OSC1 or OSC3) for each
prescaler. This is done with the source clock
selection registers CKSEL0 (timer 0) and
CKSEL1 (timer 1): when "0" is written, OSC1 is
selected and when "1" is written, OSC3 is
selected. When the 16-bit mode is selected, the
source clock is selected by register CKSEL0, and
the register CKSEL1 setting becomes invalid.
When the OSC3 oscillation circuit is made the
clock source, it is necessary to turn the OSC3
oscillation ON, prior to using the programmable
timer.
E0C88832/88862 TECHNICAL MANUAL
5 PERIPHERAL CIRCUITS AND THEIR OPERATION (Programmable Timer)
[16-bit mode]
Low-order 8-bit data
Timer 0
input
Timer 0
clock
Timer 0
Interrupt
Timer 1
underflow
request
signal
High-order 8-bit data
From the time the OSC3 oscillation circuit is
turning ON until oscillation stabilizes, an
interval of several 100 µsec to several 10 msec is
necessary. Consequently, you should allow an
adequate waiting time after turning the OSC3
oscillation circuit ON before starting the count
of the programmable timer. (The oscillation
start time will vary somewhat depending on the
oscillator and on external parts. Refer to the
oscillation start time example indicated in
Chapter 7, "ELECTRICAL CHARACTERIS-
TICS".)
At initial reset, OSC3 oscillation circuit is set to
OFF status.
(2) Selection of prescaler dividing ratio
Select the dividing ratio of each prescaler from
among 4 types. This selection is done by the
prescaler dividing ratio selection registers
PSC00/PSC01 (timer 0) and PSC10/PSC11
(timer 1). Setting value and dividing ratio
correspondence are shown in Table 5.10.3.1.
Table 5.10.3.1 Selection of prescaler dividing ratio
PSC11
PSC10
PSC01
PSC00
1
1
0
0
By writing "1" to the register PRUN0 (timer 0)
and PRUN1 (timer 1), the source clock is input
to the prescaler. Therefore, the clock with
selected dividing ratio is input to the timer and
the timer starts counting down.
When the 16-bit mode has been selected, the
dividing ratio for the source clock is selected by
register PSC00/PSC01 and the setting of register
PSC10/PSC11 becomes invalid.

5.10.4 Timer mode

The timer mode counts down using the prescaler
output as an input clock. In this mode, the pro-
grammable timer operates as a timer that obtains
fixed cycles using the OSC1 or OSC3 oscillation
circuit as a clock source.
See "5.10.2 Count operation and basic mode setting"
for basic operation and control, and "5.10.3 Setting
input clock" for the clock source and setting of the
prescaler.
EPSON
Prescaler dividing ratio
1
Source clock / 64
0
Source clock / 16
1
Source clock / 4
0
Source clock / 1
79

Advertisement

Table of Contents
loading

This manual is also suitable for:

88862

Table of Contents