Timer Mode - Renesas M16C FAMILY series Hardware Manual

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

Advertisement

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

12.1.1 Timer Mode

In timer mode, the timer counts a count source generated internally (see Table 12.1). Figure 12.7 shows
TAiMR register in timer mode.
Table 12.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
b3
0
NOTE:
1. The port direction bit for the TAi
Figure 12.7 Timer Ai Mode Register in Timer Mode
R
e
. v
2
0 .
0
J
a
. n
3
, 1
2
0
0
7
R
E
J
0
9
B
0
0
4
7
0 -
2
0
0
2 /
, 8
M
1
6
C
2 /
8
) B
f
, f
, f
, f
, f
1
2
8
32
C32
• Decrement
• 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.
b2
b1
b0
Symbol
0 0
TA0MR to TA4MR
Bit Symbol
TMOD0
Operation mode
select bit
TMOD1
Pulse output function
MR0
select bit
MR1
Gate function select bit
MR2
MR3
Set to "0" in timer mode
TCK0
Count source select bit
TCK1
pin must be set to "0" ( input mode).
IN
page 103
f o
3
8
5
Specification
Address
After Reset
0396
to 039A
00
16
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 :
(TAi
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
2
0 1 : f
8
1 0 : f
32
1 1 : f
C32
0000
to FFFF
16
IN
pin is inverted.
OUT
Function
pin is a normal port pin)
pin is a pulse output pin)
pin functions as I/O port)
IN
pin
IN
(1)
pin
IN
RW
(1)
RW
RW
12. Timer
16
pin
RW
RW
RW
RW
RW
RW

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tiny seriesM16c series

Table of Contents