Timer Mode - Renesas M16C/26A Series Hardware Manual

16-bit single-chip microcomputer m16c family / m16c/tiny series
Hide thumbs Also See for M16C/26A Series:
Table of Contents

Advertisement

M
1
6
C
2 /
6
A
G
o r
u
p
(
M
1
6

12.1.1. Timer Mode

In timer mode, the timer counts a count source generated internally (see Table 12.1.1.1). Figure 1.2.1.1.1
shows TAiMR register in timer mode.
Table 12.1.1.1. Specifications in Timer Mode
Item
Count source
Count operation
Divide ratio
Count start condition
Count stop condition
Interrupt request generation timing
TAi
pin function
IN
TAi
pin function
OUT
Read from timer
Write to timer
Select function
Timer Ai mode register (i=0 to 4)
b7
b6
b5
b4
0
NOTE:
1.The port direction bit for the TAi
Figure 12.1.1.1. Timer Ai Mode Register in Timer Mode
R
e
. v
2
0 .
0
F
e
b
1 .
, 5
2
0
0
7
R
E
J
0
9
B
0
2
0
2
0 -
2
0
0
C
2 /
6
, A
M
1
6
C
2 /
6
, B
M
1
6
f
, f
, f
, f
, f
1
2
8
32
C32
• Down-count
• When the timer underflows, it reloads the reload register contents and continues counting
1/(n+1)
n: set value of TAi register (i= 0 to 4)
Set TAiS bit in the 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
• Pulse output function
Whenever the timer underflows, the output polarity of TAi
When not counting, the pin outputs a low.
b3
b2
b1
b0
Symbol
0 0
TA0MR to TA4MR
Bit symbol
TMOD0
Operation mode
select bit
TMOD1
Pulse output function
MR0
select bit
Gate function select bit
MR1
MR2
MR3
Must be set to "0" in timer mode
TCK0
Count source select bit
TCK1
pin must be set to "0" (= input mode).
IN
page 97
f o
3
2
9
C
2 /
6
) T
Specification
Address
After reset
0396
to 039A
16
16
Bit name
b1 b0
0 0 : Timer mode
0 : Pulse is not output
(TA
iOUT
1 : Pulse is output
(TA
iOUT
b4 b3
0 0 :
Gate function not available
}
0 1 :
1 0 : Counts while input on the TAi
is low
1 1 : Counts while input on the TAi
is high
b7 b6
0 0 : f
or f
1
0 1 : f
8
1 0 : f
32
1 1 : f
C32
0000
to FFFF
16
OUT
00
16
Function
pin is a normal port pin)
pin is a pulse output pin)
(TAi
pin functions as I/O port)
IN
pin
IN
(1)
pin
IN
(1)
2
12. Timer
16
pin
IN
pin is inverted.
RW
RW
RW
RW
RW
RW
RW
RW
RW

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c/26aM16c/26bM16c/26t

Table of Contents