79
TimerA
M
i
t
s
u
M
S
b
i
s
3
M
h
0
I
C
i
m
2
R
i
1
O
c
r
8
C
o
c
o
G
M
m
p
r
P
u
t
u
T
e
r
p
R
s
o
U
S
I
N
G
L
E
-
C
H
I
P
1
6
-
B
I
T
C
M
O
O
E
Item
Specification
Count source
Count operation
f1, f
8
, f
32
, f
C32
The timer counts down
When the count reaches 0000
16
, the timer stops counting after reloading a new count
If a trigger occurs when counting, the timer reloads a new count and restarts counting
1/n n : Set value
An external trigger is input
The timer overflows
The one-shot start flag is set (= 1)
A new count is reloaded after the count has reached 0000
16
The count start flag is reset (= 0)
The count reaches 0000
16
Programmable I/O port or trigger input
Programmable I/O port or pulse output
When timer Ai register is read, it indicates an indeterminate value
When counting stopped
When a value is written to timer Ai register, it is written to both reload
register and counter
When counting in progress
When a value is written to timer Ai register, it is written to only reload register
(Transferred to counter at next reload time)
Divide ratio
Count start condition
Count stop condition
Interrupt request generation timing
TAi
IN
pin function
TAi
OUT
pin function
Read from timer
Write to timer
(3) One-shot timer mode
In this mode, the timer operates only once. (See Table 19.) When a trigger occurs, the timer starts up and
continues operating for a given period. Figure 62 shows the timer Ai mode register in one-shot timer mode.
Table 19. Timer specifications in one-shot timer mode
Figure 62. Timer Ai mode register in one-shot timer mode
B
i
t
n
a
m
e
F
u
n
c
t
i
o
n
B
i
t
s
y
O
m
D
b
0
o
l
T
7
i
m
e
r
5
0
A
i
4
m
o
3
d
e
2
r
e
1
1 0
g
i
s
0
t
e
r
S
T
y
m
i
M
b
o
R
l
(
A
d
6
d
t
r
o
e
s
0
s
3
W
h
e
0
n
0
1
r
e
6
s
e
t
A
i
=
0
t
o
4
) 0
3
9
6
1
9
A
1
6
b
b
6
b
b
b
b
b
b
O
p
e
r
a
t
i
o
n
m
o
d
e
s
e
l
e
c
t
b
i
t
1
1
1
0
:
O
n
e
-
s
h
o
t
t
i
m
e
r
m
o
d
e
b
1
b
0
T
M
O
D
1
T
M
M
R
0
P
s
u
e
l
e
s
e
c
o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