Timer Mode - 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.1 Timer Mode

In timer mode, the timer counts a count source generated internally (see Table 12.6). Figure 12.18
shows TBiMR register in timer mode.
Table 12.6 Specifications in Timer Mode
Item
Count source
Count operation
Divide ratio
Count start condition
Count stop condition
Interrupt request generation timing
TBi
pin function
IN
Read from timer
Write to timer
NOTE:
1. Bits TB0S to TB2S are assigned to the bit 7 to bit 5 in the TABSR register.
Timer Bi Mode Register (i= 0 to 2)
b7
b6
b5
b4
b3
b2
Figure 12.18 TBiMR Register in Timer Mode
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
f
, f
, f
, f
, f
1
2
8
32
C32
• Decrement
• When the timer underflows, it reloads the reload register contents and
continues counting
1/(n+1)
n: set value of TBi register (i= 0 to 2)
(1)
Set TBiS bit
to 1 (start counting)
Set TBiS bit to 0 (stop counting)
Timer underflow
I/O port
Count value can be read by reading TBi register
• When not counting and until the 1st count source is input after counting start
Value written to TBi register is written to both reload register and counter
• When counting (after 1st count source input)
Value written to TBi register is written to only reload register
(Transferred to counter when reloaded next)
b1
b0
Symbol
0
0
TB0MR to TB2MR
Bit Symbol
TMOD0
Operation mode select bit
TMOD1
MR0
No effect in timer mode
Can be set to 0 or 1
MR1
TB0MR register
Set to 0 in timer mode
MR2
TB1MR, TB2MR registers
Nothing is assigned. If necessary, set to 0. When read, its
content is undefined
When write in timer mode, set to 0. When read in timer mode, its
MR3
content is undefined
Count source select bit
TCK0
TCK1
page 119
f o
4
5
8
Specification
Address
039B
to 039D
16
16
Bit Name
b1 b0
0 0: Timer mode or A/D trigger mode
b7 b6
0 0: f
or f
1
0 1: f
8
1 0: f
32
1 1: f
C32
0000
to FFFF
16
After Reset
00XX0000
2
Function
2
12. Timer B
16
RW
RW
RW
RW
RW
RW
RO
RW
RW

Advertisement

Table of Contents
loading

Table of Contents