English
Language : 

M16C26A Datasheet, PDF (114/352 Pages) Renesas Technology Corp – 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/Tiny SERIES
M16C/26A Group (M16C/26A, M16C/26B, M16C/26T)
12. Timer
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
TAiIN pin function
TAiOUT pin function
Read from timer
Write to timer
Select function
Specification
f1, f2, f8, f32, fC32
• 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) 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
039616 to 039A16
After reset
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
Must be 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 TAiIN pin must be set to “0” (= input mode).
Figure 12.1.1.1. Timer Ai Mode Register in Timer Mode
Rev. 2.00 Feb.15, 2007 page 97 of 329
REJ09B0202-0200