deveopmen
Rev.B2 for proof reading
Timer A
Mitsubishi Microcomputers
M32C/83 group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
137
(1) Timer mode
In this mode, the timer counts an internally generated count source. (See Table 1.14.1.) Figure 1.14.7
shows the timer Ai mode register in timer mode.
Table 1.14.1. Specifications of timer mode
Item
Specification
Count source
f
1
, f
8
, f
2n
, f
C32
Count operation
Down count
When the timer underflows, it reloads the reload register contents before continuing
counting
Divide ratio
1/(m+1)m : Set value
Count start condition
Count start flag is set (= 1)
Count stop condition
Count start flag is reset (= 0)
Interrupt request generation timing
When the timer underflows
TAi
IN
pin function
Programmable I/O port or gate input
TAi
OUT
pin function
Programmable I/O port or pulse output (Setting by corresponding function select
registers A, B and C)
Read from timer
Count value can be read out by reading timer Ai register
Write to timer
When counting stopped
When a value is written to timer Ai register, it is written to both reload register and
counter
When counting in progress
When a value is written to timer Ai register, it is written to only reload register
(Transferred to counter at next reload time)
Select function
Gate function
Counting can be started and stopped by the TAi
IN
pin
’
s input signal
Pulse output function
Each time the timer underflows, the TAi
OUT
pin
’
s polarity is reversed
Figure 1.14.7. Timer Ai mode register in timer mode
Timer Ai mode register
(i = 0 to 4) (Timer mode)
Symbol
TAiMR(i=0 to 4)
Address
When reset
00000X00
2
0356
16
, 0357
16
, 0358
16
, 0359
16
, 035A
16
Bit name
Function
Bit symbol
TMOD0
W
R
b7
b6
b5
b4
b3
b2
b1
b0
0 0 : Timer mode
b1 b0
TCK1
MR3
MR2
MR1
TMOD1
MR0
TCK0
Count source
select bit
Operation mode
select bit
This bit is invalid in M32C/80 series.
Port output control is set by the function select
registers A, B and C.
Note 1: X value can be
“
0
”
or
“
1
”
.
Note 2: Set the corresponding function select register A to I/O port, and port direction register to
“
0
”
.
Note 3: n = 0 to 15. n is set by the count source prescaler register (address 035F
16
).
Gate function
select bit
0 X
: Gate function not available
(TAi
IN
pin is a normal port pin)
1 0 : Timer counts only when TA
iIN
pin is held
“
L
”
1 1 : Timer counts only when TA
iIN
pin is held
“
H
”
0 (Set to
“
0
”
in timer mode)
(Note 2)
(Note 2)
(Note 1)
(Note 3)
b4 b3
0 0 : f
1
0 1 : f
8
1 0 : f
2n
1 1 : f
C32
b7 b6