
M30245 Group
Timer A
Rev.2.00
Oct 16, 2006
page 115 of 264
REJ03B0005-0200
Timer mode
In this mode, the timer counts an internally generated count source. Timer A in timer mode specifications are shown in
Table 1.39. Figure 1.81 shows the Timer Ai mode register in timer mode.
Table 1.39. Timer mode specifications
Item
Specification
Count source
f1, f8, f32, fc32
Count operation
Down count
When the timer underflows, it loads the reload register contents before continuing counting
Divide ratio
1/(n+1) n: 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
TAiIN pin function
Programmable I/O port or gate input.
TAiOUT pin function
Programmable I/O port or pulse output.
Read from timer
Count value can be read out by reading Timer Ai register
Write to timer
When counting is stopped and a value is written to Timer Ai register, it is written to both the
reload register and counter
Whencountingis in progressand avalue iswritten to Timer Ai register, itis written only to the
reload register (to be transferred to counter at the next reload time)
Select function
Gate function-Counting can be started and stopped by TAiIN pin's input signal
Pulse output function-Each time the timer underflows, the TAiOUT pin's polarity isreversed
Figure 1.81. Timer Ai mode register in timer mode
Bit Symbol
Bit Name
Function
R W
TMOD0
Operation mode
select bit
Symbol
TAiMR (i=0 to 4)
Address
0396
16 to 039A16
When reset
00000X00
2
Timer Ai mode register (i = 0 to 4)
b7
b5
b6
b4
b3
b2
b1
b0
O O
TMOD1
O O
0 0 : Timer mode
b1 b0
MR0
MR1
MR2
Count source select bit
Gate function select bit
0 X : Gate funciton not available
(TAiIN pin is a normal port pin) (Note 1)
1 0 : Timer counts only when TAiIN pin
is held "L" (Note 2)
1 1 : Timer counts only when TAiIN pin
is held "H" (Note 2)
b4 b3
0 0 : f1
0 1 : f8
1 0 : f32
1 1 : fc32
b7 b6
MR3
TCK0
TCK1
0 (Set to "0" in timer mode)
Note 1: X value can be "0" or "1"
Note 2: Set the corresponding port direction register to "0".
Pulse output function
select bit
0 : Pulse is not output
(TAiOUT pin is a normal port pin)
1 : Pulse is output
(TAiOUT pin is a pulse output pin)
O O