Unde
Timer B
deeopmen
Mitsubishi microcomputers
M30201 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
62
Item
Specification
Count source
External signals input to TBi
IN
pin
Effective edge of count source can be a rising edge, a falling edge, or falling
and rising edges as selected by software
Counts down
When the timer underflows, it reloads the reload register contents before
continuing counting
1/(n+1)
n : Set value
Count start flag is set (= 1)
Count start flag is reset (= 0)
Interrupt request generation timing
The timer underflows
TBi
IN
pin function
Count source input
Read from timer
Count value can be read out by reading timer Bi register
Write to timer
When counting stopped
When a value is written to timer Bi register, it is written to both reload register
and counter
When counting in progress
When a value is written to timer Bi register, it is written to only reload register
(Transferred to counter at next reload time)
Count operation
Divide ratio
Count start condition
Count stop condition
(2) Event counter mode
In this mode, the timer counts an external signal or an internal timer's overflow. (See Table 1.19.) Figure
1.52 shows the timer Bi mode register in event counter mode.
Table 1.19. Timer specifications in event counter mode
Figure 1.52. Timer Bi mode register in event counter mode
Timer Bi mode register
AA
Symbol
TBiMR(i=0, 1)
Address
When reset
00XX0000
2
039B
16
to 039C
16
Bit name
Function
Bit symbol
TMOD0
W
R
b7
b6
b2
b1
0 1
b0
Operation mode select bit
0 1 : Event counter mode
b1 b0
TMOD1
MR0
Count polarity select
bit (Note 1)
MR1
MR3
Invalid in event counter mode.
This bit can neither be set nor reset. When read in event
counter mode, its content is indeterminate.
TCK1
TCK0
falling edges
0 1 : Counts external signal's
rising edges
1 0 : Counts external signal's
falling and rising edges
1 1 : Inhibited
b3 b2
Note 1: Valid only when input from the TBi
IN
pin is selected as the event clock.
If timer's overflow is selected, this bit can be “0” or “1”.
Note 2: Set the corresponding port direction register to “0” (input mode).
Invalid in event counter mode.
Can be “0” or “1”.
Event clock select
0 : Input from TBi
IN
pin (Note 2)
1 : TBj overflow
( j = 1 when i = 0,
j = 0 when i = 1)
AA
A
AA
A
A
A
AA
A
A
A
A
A
Nothing is assigned.
When write, set "0". When read, their contents are indeterminate.