Timers (Timer A)
112
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 TAiMR register (i= 0 to 4) 0000
16
to FFFF
16
Set TAiS bit of TABSR register to “1” (= start counting)
Set TAiS bit to “0” (= stop counting)
Timer underflow
I/O port or gate input
I/O port or pulse output
Count value can be read by reading TAi register
When not counting and until the 1st count source is input after counting start
Value written to TAi register is written to both reload register and counter
When counting (after 1st count source input)
Value written to TAi register is written to only reload register
(Transferred to counter when reloaded next)
Gate function
Counting can be started and stopped by an input signal to TAi
IN
pin
Pulse output function
Whenever the timer underflows, the output polarity of TAi
OUT
pin is inverted.
When not counting, the pin outputs a low.
Divide ratio
Count start condition
Count stop condition
Interrupt request generation timing
TAi
IN
pin function
TAi
OUT
pin function
Read from timer
Write to timer
Select function
1. Timer Mode
In timer mode, the timer counts a count source generated internally (see Table 1.14.1). Figure 1.14.7
shows TAiMR register in timer mode.
Table 1.14.1. Specifications in Timer Mode
Note 1: TA0
OUT
pin is N-channel open drain output.
Note 2: The port direction bit for the TAi
IN
pin must be set to “0” (= input mode).
Timer Ai mode register (i=0 to 4)
Symbol
Address
After reset
00
16
TA0MR to TA4MR
0396
16
to 039A
16
Bit name
Function
Bit symbol
RW
RW
b7
b6
b5
0
b4
b3
b2
b1
0 0
b0
Operation mode
select bit
0 0 : Timer mode
b1 b0
TMOD1
MR0
TMOD0
Pulse output function
select bit
0 : Pulse is not output
(TA
iOUT
pin is a normal port pin)
1 : Pulse is output (Note 1)
(TA
iOUT
pin is a pulse output pin)
Gate function select bit
0 0 :
Gate function not available
0 1 : (TAi
IN
pin functions as I/O port)
1 0 : Counts while input on the TAi
IN
pin
is low (Note 2)
1 1 : Counts while input on the TAi
IN
pin
is high (Note 2)
b4 b3
MR2
MR1
MR3
Must be set to “0” in timer mode
0 0 : f
1
or f
2
0 1 : f
8
1 0 : f
32
1 1 : f
C32
b7 b6
TCK1
TCK0
Count source select bit
RW
RW
RW
RW
RW
RW
RW
Figure 1.14.7. Timer Ai Mode Register in Timer Mode