26
7641 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
MITSUBISHI MICROCOMPUTERS
PRELIMINARY
Notice: This is not a final specification.
change.
Some parametric limits are subject to
Timer Y
Timer Y is a 16-bit timer that can be selected in one of four modes.
(1) Timer Mode
The timer counts one of the internal clock
φ
divided by 8, 16, 32,
64.
G
TY
OUT
Output Function
In the timer mode, a signal of which polarity is inverted each time
the timer underflows is output from the CNTR
1
pin. This is enabled
by setting the Timer Y Output Control Bit to
“
1
”
.
When the CNTR
1
Active Edge Switch Bit is
“
0
”
, the CNTR
1
pin
starts pulses output beginning at
“
H
”
; when this bit is
“
1
”
, the
CNTR
1
pin starts pulses output beginning at
“
L
”
.
When using a timer in this mode, set the port P4
4
direction regis-
ter to output mode.
(2) Period Measurement Mode
CNTR
1
interrupt request is generated at a rising/falling edge of
CNTR
1
pin input signal. Simultaneously, the value in timer Y latch
is reloaded in timer Y and timer Y continues counting down. Ex-
cept for the aforementioned operation, the operation in period
measurement mode is the same as in timer mode. (The TY
OUT
output function is not usable.)
The timer value just before the reloading at rising/falling of CNTR
1
pin input signal is retained until the timer Y is read once after the
reload.
The rising/falling timing of CNTR
1
pin input signal is found by
CNTR
1
interrupt.
When the CNTR
1
Active Edge Switch Bit is
“
0
”
, the falling edge is
detected; when this bit is
“
1
”
, the rising edge is detected.
When using a timer in this mode, set the port P4
4
direction regis-
ter to input mode.
(3) Event Counter Mode
The timer counts signals input through the CNTR
1
pin.
Except for this, the operation in event counter mode is the same
as in timer mode. (The TY
OUT
output function is not usable.)
When the CNTR
1
Active Edge Switch Bit is
“
0
”
, the rising edge is
counted; when this bit is
“
1
”
, the falling edge is counted.
When using a timer in this mode, set the port P4
4
direction regis-
ter to input mode.
(4) Pulse Width HL Continuously Measurement
Mode
CNTR
1
interrupt request is generated at both rising and falling
edges of CNTR
1
pin input signal. Except for this, the operation in
pulse width HL continuously measurement mode is the same as in
period measurement mode.
When using a timer in this mode, set the port P4
4
direction regis-
ter to input mode.
Fig. 21 Structure of timer Y mode register
I
Notes
G
Timer Y Write Control
If the Timer Y Write Control Bit is
“
1
”
, when the value is written in
the address of timer Y, the value is loaded only in the latch. The
value in the latch is loaded in timer Y after timer Y underflows.
If the Timer Y Write Control Bit is
“
0
”
, when the value is written in
the address of timer Y, the value is loaded in the timer Y and the
latch at the same time.
When the value is to be written in latch only, unexpected value
may be set in the high-order timer if the writing in high-order latch
and the underflow of timer Y are performed at the same timing.
G
CNTR
1
Interrupt Active Edge Selection
The CNTR
1
interrupt active edge depends on the selection of
CNTR
1
Active Edge Switch Bit.
However, in pulse width HL continuously measurement mode,
CNTR
1
interrupt request is generated at both rising and falling
edges of CNTR
1
pin input signal regardless of the setting of
CNTR
1
Active Edge Switch Bit.
T
T
i
Y
m
e
r
Y
m
o
d
e
r
e
g
i
s
t
e
r
(
a
d
d
r
e
s
s
0
0
2
8
1
6
)
M
T
i
0
1
i
m
0
1
i
m
m
:
:
e
W
W
e
:
T
:
T
e
r
Y
r
i
r
i
Y
Y
O
Y
O
r
Y
e
t
e
w
o
T
T
c
r
v
v
u
i
a
a
t
o
o
u
t
e
l
l
p
u
u
n
c
e
e
t
p
t
p
t
o
c
u
u
s
n
i
n
i
n
o
t
t
o
t
n
d
e
u
r
l
l
o
a
a
t
i
s
n
r
c
l
t
t
c
c
o
a
a
e
b
h
h
l
b
b
s
i
t
b
l
l
e
e
t
u
u
u
t
a
o
i
e
n
n
t
d
d
l
e
d
l
y
c
o
u
n
t
e
r
T
r
r
U
U
T
o
c
t
b
i
t
s
b
3
b
2
0
0
1
1
i
m
0
1
0
1
e
:
:
:
:
φ
φ
φ
φ
r
/
/
/
/
o
8
1
3
6
6
2
4
p
T
Y
e
r
a
t
i
n
g
m
o
d
e
b
i
t
s
b
5
b
0
1
0
1
4
0
0
1
1
:
:
:
:
T
P
E
P
m
i
e
v
u
e
a
u
e
a
e
r
F
a
S
t
a
C
o
M
e
p
e
R
i
s
S
t
a
e
r
Y
C
o
:
C
o
m
r
e
l
e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