180
Timer A
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
2.2.1 Overview
The following is an overview for timer A, a 16-bit timer.
(1) Mode
Timer A operates in one of the four modes:
(a) Timer mode
In this mode, the internal count source is counted. Two functions can be selected: the pulse output
function that reverses output from a port every time an overflow occurs, or the gate function which
controls the count start/stop according to the input signal from a port.
Timer mode operation .............................................................................................................. P186
Timer mode, gate function operation........................................................................................ P188
Timer mode, pulse output function operation ........................................................................... P190
(b) Event counter mode
This mode counts the pulses from the outside and the number of underflows in other timers. The
free-run type, in which nothing is reloaded from the reload register, can be selected when an under-
flow occurs. The pulse output function can also be selected. Please refer to the timer mode expla-
nation for details, as the operation is identical.
Event counter mode operation ................................................................................................. P192
Event counter mode, free run type operation ........................................................................... P194
Furthermore, Timer A has a 2-phase pulse signal processing function which generates an up count
or down count in the event counter mode, depending on the phase of the two input signals.
Operation of the 2-phase pulse signal processing function in normal event counter mode ..... P196
Operation of the 2-phase pulse signal processing function in 4-multiplication mode ............... P198
(c) One-shot timer mode
In this mode, the timer is started by the trigger and stops when the timer goes to “0”. The trigger can
be selected from the following 3 types: an external input signal, an overflow of the timer, or a software
trigger. The pulse output function can also be selected. Please refer to the timer mode explanation
for details, as the operation is identical.
Operation in one-shot timer mode effected by software........................................................... P200
Operation in one-shot timer mode effected by an external trigger ........................................... P202
(d) Pulse width modulation (PWM) mode
In this mode, the arbitrary pulses are successively output. Either a 16-bit fixed-period PWM mode or
8-bit variable-period mode can be selected. The trigger for initiating output can also be selected.
Please refer to the one-shot timer mode explanation for details, as the operation is identical.
16-bit PWM mode operation..................................................................................................... P204
8-bit PWM mode operation....................................................................................................... P206
2.2 Timer A