
R8C/10 Group
Rev.1.20 Jan 27, 2006 page 56 of 180
REJ09B0019-0120
T
X
C
K
1
t
o
T
X
C
K
=
0
0
f
1
f
8
f
32
f
2
Toggle flip-flop
P
o
l
a
r
i
t
y
s
w
i
t
c
h
i
n
g
Q
Q
C
TXOCNT bit
CNTR0
R0EDG=0
CLR
T
X
M
O
D
1
t
o
T
X
M
O
D
0
b
i
t
s
=
0
12
Counter
Reload registe
C
o
u
n
t
e
r
R
e
l
o
a
d
r
e
g
i
s
t
e
T
X
S
b
i
t
PREX register
TX registe
Write to TX registe
T
i
m
e
r
X
i
n
t
e
r
r
u
p
t
Data bus
I
N
T
1
i
n
t
e
r
r
u
p
t
I
N
T1/
C
N
T
R0
R0EDG =1
T
X
M
O
D
1
t
o
T
X
M
O
D
0
b
i
t
s
=
0
1
2
=
0
12
=
1
02
=
1
12
T
X
M
O
D
1
t
o
T
X
M
O
D
=
0
02
o
r
0
1
=
1
02
=
1
12
Figure 12.1 Timer X Block Diagram
Figure 12.2 TXMR Register
12.1 Timer X
The Timer X is an 8-bit timer with an 8-bit prescaler. Figure 12.1 shows the block diagram of Timer X.
Figures 12.2 and 12.3 show the Timer X-related registers.
The Timer X has five operation modes listed as follows:
• Timer mode: The timer counts an internal count source.
• Pulse output mode: The timer counts an internal count source and outputs the pulses
whose polarity is inverted at the timer the timer underflows.
• Event counter mode: The timer counts external pulses.
• Pulse width measurement mode: The timer measures an external pulse's pulse width.
• Pulse period measurement mode:The timer measures an external pulse's period.
12.1 Timer (Timer X)
T
i
m
e
r
X
m
o
d
e
r
e
g
i
s
t
e
r
Symbol Address After reset
TXMR 008B
16
00
16
B
i
t
n
a
m
e
FunctionB
i
t
s
y
m
b
o
l
RW
7
6
5
4
3
2
1
0
0 0 : Timer mode or
pulse period measurement mode
0 1 : Pulse output mode
1 0 : Event counter mode
1 1 : Pulse width measurement mode
b1 b0
T
X
M
O
D
2
TXS
T
X
M
O
D
1
R0EDG
T
X
M
O
D
0
TXOCNT
I
N
T
1
/
C
N
T
R
0
p
o
l
a
r
i
t
y
s
w
i
t
c
h
i
n
g
b
i
t
(1
)
Operation mode
select bit 0, 1
T
i
m
e
r
X
c
o
u
n
t
s
t
a
r
t
f
l
a
g
0 : Stops counting
1 : Starts counting
P
3
0
/
C
N
T
R
0
s
e
l
e
c
t
b
i
t
Operation mode
select bit 2
0 : Except in pulse period measurement mode
1 : Pulse period measurement mode
Function varies with each operation mode
T
X
E
D
G
T
X
U
N
D
T
i
m
e
r
X
u
n
d
e
r
f
l
o
w
f
l
a
g
Function varies depending on operation mode.
Active edge
reception flag
F
u
n
c
t
i
o
n
v
a
r
i
e
s
d
e
p
e
n
d
i
n
g
o
n
o
p
e
r
a
t
i
o
n
m
o
d
e
.
RW
RW
RW
RW
RW
RW
RW
RW
Function varies with each operation mode
N
O
T
E
S
:
1
.
T
h
e
I
R
b
i
t
i
n
t
h
e
I
N
T
1
I
C
r
e
g
i
s
t
e
r
m
a
y
b
e
s
e
t
t
o
“
1
”
(
i
n
t
e
r
r
u
p
t
r
e
q
u
e
s
t
e
d
)
w
h
e
n
t
h
e
R
0
E
D
G
b
i
t
i
s
r
e
w
r
i
t
t
e
n
.
R
e
f
e
r
t
o
t
h
e
p
a
r
a
g
r
a
p
h
1
9
.
2
.
5
“
C
h
a
n
g
i
n
g
I
n
t
e
r
r
u
p
t
F
a
c
t
o
r
”
i
n
t
h
e
U
s
a
g
e
N
o
t
e
s
R
e
f
e
r
e
n
c
e
B
o
o
k
.
Comentários a estes Manuais