Timer Mode - Renesas M16C Series User Manual

16-bit single-chip microcomputer
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

M30240 Group

1.2.21.1 Timer mode

In this mode, the timer counts an internally generated count source. See Table 1.18 below. Figure
1.63 shows the timer Ai mode register in timer mode.
Table 1.18:
Specifications of timer mode
Item
Count source
f1, f8, f32
• Down count
Count operation
• When the timer underflows, it loads the reload register contents before continuing counting
Divide ratio
1/(n+1) n: Set value
Count start
Count start flag is set (= 1)
condition
Count stop
Count start flag is reset (= 0)
condition
Interrupt request
When the timer underflows
generation timing
TAi
pin function
Programmable I/O port or gate input
IN
TAi
pin function
Programmable I/O port or pulse output
OUT
Read from timer
Count value can be read out by reading timer Ai register
• When counting is stopped and a value is written to timer Ai register, it is written to both reload
register and counter
Write to timer
• When counting is in progress and a value is written to timer Ai register, it is written only to
reload register (to be transferred to counter at the next reload time)
• Gate function
Counting can be started and stopped by TAi
Select function
• Pulse output function
Each time the timer underflows, the TAi
Timer Ai mode register
b7
b6
b5
b4
0
Figure 1.63: Timer Ai mode register in timer mode
Rev.1.00 Sep 24, 2003 Page 69 of 360
b3
b2
b1
b0
Symbol
0 0
TAiMR(i=0 to 4)
Bit symbol
Bit name
TMOD0
Operation mode select bit
TMOD1
Pulse output function
MR0
select bit
Gate function select bit
MR1
MR2
MR3
0 (Must always be fixed to "0" in timer mode)
TCK0
Count source select bit
TCK1
Note 1: The settings of the corresponding port register and port direction register are invalid.
Note 2: The bit can be "0" or "1".
Note 3: Set the corresponding port direction register to "0".
Specification
pin's input signal
IN
pin's polarity is reversed
OUT
Address
When reset
0396
to 039A
16
16
Function
b1 b0
0 0 : Timer mode
0 : Pulse is not output
(TA
pin is a normal port pin)
iOUT
1 : Pulse is output (Note 1)
(TA
pin is a pulse output pin)
iOUT
b4 b3
: Gate function not available
0 X
(Note 2)
(TAi
pin is a normal port pin)
IN
1 0 : Timer counts only when TA
held "L" (Note 3)
1 1 : Timer counts only when TA
held "H" (Note 3)
b7 b6
0 0 : f
1
0 1 : f
8
1 0 : f
32
1 1 : Reserved
00
16
R
W
pin is
iIN
pin is
iIN
Timer A

Advertisement

Table of Contents
loading

Table of Contents