Timers (Timer B)
125
Mitsubishi microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
development
Preliminary Specifications Rev.1.0
Specifications in this manual are tentative and subject to change.
Item
Specification
Count source
Count operation
f
1
, f
2
, f
8
, f
32
, f
C32
Down-count
When the timer underflows, it reloads the reload register contents and
continues counting
1/(n+1)
n: set value of TBiMR register (i= 0 to 5) 0000
16
to FFFF
16
Set TBiS bit
(Note)
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)
Note : The TB0S to TB2S bits are assigned to the TABSR register bit 5 to bit 7, and the TB3S to TB5S
bits are assigned to the TBSR register bit 5 to bit 7.
Divide ratio
Count start condition
Count stop condition
Interrupt request generation timing
TBi
IN
pin function
Read from timer
Write to timer
1. Timer Mode
In timer mode, the timer counts a count source generated internally (see Table 1.15.1). Figure 1.15.4
shows TBiMR register in timer mode.
Table 1.15.1. Specifications in Timer Mode
Timer Bi mode register (i= 0 to 5)
AA
Symbol
Address
After reset
00XX0000
2
00XX0000
2
TB0MR to TB2MR
TB3MR to TB5MR
039B
16
to 039D
16
035B
16
to 035D
16
Bit name
Function
Bit symbol
RW
RW
RW
RW
RW
b7
b6
b5
b4
b3
b2
b1
0
b0
0
AA
Operation mode select bit
0 0 : Timer mode
TMOD1
TMOD0
MR0
MR1
Has no effect in timer mode
Can be set to “0” or “1”
MR2
MR3
0 0 : f
1
or f
2
0 1 : f
8
1 0 : f
32
1 1 : f
C32
TCK1
TCK0
Count source select bit
TB0MR, TB3MR registers
Must be set to “0” in timer mode
TB1MR, TB2MR, TB4MR, TB5MR registers
Nothing is assigned. When write, set to “0”. When read, its
content is indeterminate
b7 b6
RW
RW
RW
RO
When write in timer mode, set to “0”. When read in timer mode, its
content is indeterminate.
Figure 1.15.4. TBiMR Register in Timer Mode