English
Language : 

M16C29 Datasheet, PDF (130/499 Pages) Renesas Technology Corp – RENESAS MCU M16C FAMILY / M16C/Tiny SERIES
M16C/29 Group
12. Timer A
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
TAiIN pin function
TAiOUT pin function
Read from timer
Write to timer
Select function
Specification
f1, f2, f8, f32, fC32
• 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) 000016 to FFFF16
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 TAiIN pin
• Pulse output function
Whenever the timer underflows, the output polarity of TAiOUT pin is inverted.
When not counting, the pin outputs a low.
Timer Ai Mode Register (i=0 to 4)
b7 b6 b5 b4 b3 b2 b1 b0
0
00
Symbol
TA0MR to TA4MR
Address
After Reset
039616 to 039A16 0016
Bit Symbol
TMOD0
TMOD1
MR0
Bit Name
Operation mode
select bit
Pulse output function
select bit
MR1
Gate function select bit
MR2
Function
RW
b1 b0
RW
0 0: Timer mode
RW
0: Pulse is not output
(TAiOUT pin is a normal port pin)
1: Pulse is output
RW
(TAiOUT pin is a pulse output pin)
b4 b3
} 0 0: Gate function not available
0 1: (TAiIN pin functions as I/O port)
RW
1 0: Counts while input on the TAi IN pin
is low (1)
1 1: Counts while input on the TAi IN pin RW
is high(1)
MR3
Set to 0 in timer mode
RW
TCK0
Count source select bit
b7 b6
0 0: f1 or f2
RW
0 1: f8
TCK1
1 0: f32
1 1: fC32
RW
NOTE:
1. The port direction bit for the TAi IN pin must be set to 0 ( input mode).
Figure 12.7 Timer Ai Mode Register in Timer Mode
Rev. 1.12 Mar.30, 2007 page 106 of 458
REJ09B0101-0112