
R8C/10 Group
Rev.1.20 Jan 27, 2006 page 60 of 180
REJ09B0019-0120
12.1.3 Event Counter Mode
_____
In this mode, the timer counts an external signal fed to INT1/CNTR0 pin (See “Table 12.4 Event
Counter Mode Specifications”). Figure 12.6 shows TXMR register in event counter mode.
Item Specification
Count source External signals fed to CNTR0 pin (Active edge is selected by program)
Count operation • Down count
• When the timer underflows, the contents in the reload register is reloaded and the count
is continued
Divide ratio 1/(n+1)(m+1) n: set value of PREX register, m: set value of TX register
Count start condition Write “1” (count start) to TXS bit in TXMR register
Count stop condition Write “0” (count stop) to TXS bit in TXMR register
Interrupt request • When Timer X underflows [Timer X interrupt]
generation timing
INT1/CNTR0 pin function
_______
Count source input (INT1 interrupt input)
CNTR0 pin function Programmable I/O port
Read from timer Count value can be read by reading TX register
Same applies to
PREX
register.
Write to timer
Value written to TX register is written to both reload register and counter.
Same applies to
PREX
register.
Select function
_____
• INT1/CNTR0 polarity switching function
Active edge of count source can be selected with R0EDG.
T
i
m
e
r
X
m
o
d
e
r
e
g
i
s
t
e
r
S
y
m
b
o
lA
d
d
r
e
s
sA
f
t
e
r
r
e
s
e
t
T
X
M
R0
0
8
B
1
6 0
01
6
Bit name
FunctionB
i
t
s
y
m
b
o
l
RW
7
6
5
4
3
2
1
0
1 0 : Event counter mode
b1 b0
T
X
M
O
D
2
T
X
S
T
X
M
O
D
1
R
0
E
D
G
T
X
M
O
D
0
TXOCNT
Operation mode
select bit 0, 1
Timer X count
start flag
0 : Stops counting
1 : Starts counting
0
0
Set to "0" in event counter mode
0 : Rising edge
1 : Falling edge
0
T
X
E
D
G
T
X
U
N
D
RW
R
W
R
W
R
W
R
W
R
W
R
W
R
W
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
)
Set to "0" in event counter mode
S
e
t
t
o
"
0
"
i
n
e
v
e
n
t
c
o
u
n
t
e
r
m
o
d
e
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
a
r
a
r
a
h
1
9
.
2
.
5
“
C
h
a
n
i
n
I
n
t
e
r
r
u
t
F
a
c
t
o
r
”
i
n
t
h
e
U
s
a
e
N
o
t
e
s
R
e
f
e
r
e
n
c
e
B
o
o
k
.
00
1
S
e
t
t
o
"
0
"
i
n
e
v
e
n
t
c
o
u
n
t
e
r
m
o
d
e
Figure 12.6 TXMR Register in Event Counter Mode
Table 12.4 Event Counter Mode Specifications
12.1 Timer (Timer X)
Komentáře k této Příručce