Timer Mode - Renesas M16C/29 Series Hardware Manual

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

Advertisement

M16C/29 Group

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
0
Note 1: The port direction bit for the TAi
Figure 12.1.1.1. Timer Ai Mode Register in Timer Mode
Rev.1.00 Nov 01,2004
REJ09B0101-0100Z
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 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
• Pulse output function
Whenever the timer underflows, the output polarity of TAi
When not counting, the pin outputs a low.
b4
b3
b2
b1
b0
Symbol
TA0MR to TA4MR
0 0
Bit symbol
TMOD0
TMOD1
MR0
MR1
MR2
MR3
TCK0
TCK1
page 98 of 402
Specification
Address
0396
to 039A
16
16
Bit name
Operation mode
b1 b0
0 0 : Timer mode
select bit
Pulse output function
0 : Pulse is not output
select bit
(TA
1 : Pulse is output
(TA
Gate function select bit
b4 b3
0 0 :
0 1 :
1 0 : Counts while input on the TAi
1 1 : Counts while input on the TAi
Must be set to "0" in timer mode
b7 b6
Count source select bit
0 0 : f
0 1 : f
1 0 : f
1 1 : f
pin must be set to "0" (= input mode).
IN
0000
to FFFF
16
OUT
After reset
00
16
Function
pin is a normal port pin)
iOUT
pin is a pulse output pin)
iOUT
Gate function not available
}
(TAi
pin functions as I/O port)
IN
pin
IN
is low
(Note 1)
pin
IN
is high
(Note 1)
or f
1
2
8
32
C32
12.1 Timer A
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 seriesM16c/tiny series

Table of Contents