Timer B - 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.2 Timer B

Figure 12.15 shows a block diagram of the timer B. Figures 12.16 and 12.17 show registers related to the
timer B.
Timer B supports the following four modes. Use bits TMOD1 and TMOD0 in the TBiMR register (i = 0 to 2)
to select the desired mode.
• Timer mode: The timer counts the internal count source.
• Event counter mode: The timer counts the external pulses or overflows and underflows of other timers.
• Pulse period/pulse width measurement mode: The timer measures the pulse period or pulse width of
external signal.
• A/D trigger mode: The timer starts counting by one trigger until the count value becomes 0000
This mode is used together with simultaneous sample sweep mode or delayed trigger mode 0 of A/D
converter to start A/D conversion.
Clock source selection
f
or f
1
2
f
8
f
32
f
C32
TBi
IN
(i = 0 to 2)
Can be selected in
onlyevent counter mode
TBj overflow
(j = i – 1, except j = 2 if i = 0)
NOTE:
1. Overflow or underflow.
Figure 12.15 Timer B Block Diagram
Timer Bi Mode Register (i=0 to 2)
b7
b6
b5
b4
b3
NOTES:
1. Timer B0.
2. Timer B1, Timer B2.
Figure 12.16 TB0MR to TB2MR 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 mode
• Pulse period/, pulse width measuring mode
• A/D trigger mode
• Event counter
Polarity switching,
edge pulse
(1)
b2
b1
b0
Symbol
TB0MR to TB2MR
Bit Symbol
Operation mode select bit
TMOD0
TMOD1
MR0
MR1
MR2
MR3
TCK0
Count source select bit
TCK1
page 117
f o
4
5
8
Clock selection
TABSR register
Counter reset circuit
TBi
Timer B0
Timer B1
Timer B2
Address
After Reset
039B
to 039D
00XX0000
16
16
Bit Name
b1 b0
0 0 : Timer mode or A/D trigger mode
0 1 : Event counter mode
1 0 : Pulse period measurement mode,
pulse width measurement mode
1 1 : Do not set
Function varies with each operation
mode
Function varies with each operation
mode
Data bus high-order bits
Data bus low-order bits
High-order 8 bits
Low-order 8 bits
Reload register
Counter
Address
TBj
0391
0390
Timer B2
-
16
16
0393
0392
Timer B0
-
16
16
0395
0394
Timer B1
-
16
16
2
Function
RW
RW
RW
RW
RW
RW
RO
RW
RW
12. Timer B
.
16
(1)
(2)

Advertisement

Table of Contents
loading

Table of Contents