Timer A - Renesas M16C/29 Series User Manual

Hide thumbs Also See for M16C/29 Series:
Table of Contents

Advertisement

M
1
6
C
2 /
9
G
o r
u
p

12.1 Timer A

Figure 12.3 shows a block diagram of the timer A. Figures 12.4 to 12.6 show registers related to the timer A.
The timer A supports the following four modes. Except in event counter mode, timers A0 to A4 all have the
same function. Use bits TMOD1 to TMOD0 in the TAiMR register (i = 0 to 4) to select the desired mode.
• Timer mode: The timer counts an internal count source.
• Event counter mode: The timer counts pulses from an external device or overflows and underflows of
other timers.
• One-shot timer mode: The timer outputs a pulse only once before it reaches the minimum count 0000
• Pulse width modulation (PWM) mode: The timer outputs pulses in a given width successively.
Clock source
selection
f
or f
1
2
f
8
f
32
f
C32
Polarity
selection
TAi
IN
(i = 0 to 4)
(1)
TB2 overflow
(1)
TAj overflow
(j = i – 1. however, j = 4 when i = 0)
TAk overflow
(k = i + 1. however, k = 0 when i = 4)
TAi
OUT
(i = 0 to 4)
NOTE:
1. Overflow or underflow
Figure 12.3 Timer A Block Diagram
Timer Ai Mode Register (i=0 to 4)
b7
b6
b5
b4
Figure 12.4 TA0MR to TA4MR Registers
R
e
. v
1
1 .
2
M
r a
3 .
, 0
2
0
0
7
R
E
J
0
9
B
0
1
0
1
0 -
1
1
2
• Timer
• One shot
• PWM
• Timer
(gate function)
• Event counter
Clock selection
To external
trigger circuit
Pulse output
b3
b2
b1
b0
Symbol
TA0MR to TA4MR
Bit Symbol
TMOD0
TMOD1
MR0
MR1
MR2
MR3
TCK0
TCK1
page 103
f o
4
5
8
Data bus high-order bits
Data bus low-order bits
Low-order
8 bits
Reload register
Clock selection
TABSR register
Decrement
UDF register
Toggle flip-flop
Address
0396
to 039A
16
Bit Name
b1 b0
Operation mode select bit
0 0 : Timer mode
0 1 : Event counter mode
1 0 : One-shot timer mode
1 1 : Pulse width modulation
Function varies with each
operation mode
Function varies with each
Count source select bit
operation mode
High-order
8 bits
Counter
Increment/decrement
Always counts down except
in event counter mode
TAi
Addresses
TAj
Timer A0 0387
- 0386
Timer A4
16
16
Timer A1 0389
- 0388
Timer A0
16
16
Timer A2 038B
- 038A
Timer A1
16
16
Timer A3 038D
- 038C
Timer A2
16
16
Timer A4 038F
- 038E
Timer A3
16
16
After Reset
00
16
16
Function
(PWM) mode
12. Timer A
.
16
TAk
Timer A1
Timer A2
Timer A3
Timer A4
Timer A0
RW
RW
RW
RW
RW
RW
RW
RW
RW

Advertisement

Table of Contents
loading

Table of Contents