English
Language : 

M16C6NK Datasheet, PDF (137/404 Pages) Renesas Technology Corp – 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/60 SERIES
Under development
This document is under development and its contents are subject to change.
M16C/6N Group (M16C/6NK, M16C/6NM)
13. Timers
13.1.1 Timer Mode
In timer mode, the timer counts a count source generated internally. Table 13.1 lists specifications in
timer mode. Figure 13.7 shows TAiMR register in timer mode.
Table 13.1 Specifications in Timer Mode
Item
Specification
Count Source
f1, f2, f8, f32, fC32
Count Operation
• Down-count
• When the timer underflows, it reloads the reload register contents and continues counting
Divide Ratio
1/(n+1) n: set value of the TAi register 0000h to FFFFh
Count Start Condition Set the TAiS bit in the TABSR register to “1” (start counting)
Count Stop Condition Set the TAiS bit to “0” (stop counting)
Interrupt Request Generation Timing Timer underflow
TAiIN Pin Function
I/O port or gate input
TAiOUT Pin Function I/O port or pulse output
Read from Timer
Count value can be read by reading the TAi register
Write to Timer
• When not counting and until the 1st count source is input after counting start
Value written to the TAi register is written to both reload register and counter
• When counting (after 1st count source input)
Value written to the TAi register is written to only reload register
(Transferred to counter when reloaded next)
Select Function
• 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 TAiS bit is set to “0 ” (stop counting), the pin outputs a low.
i = 0 to 4
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
0396h to 039Ah
00h
Bit Symbol
Bit Name
Function
RW
TMOD0 Operation Mode
b1 b0
RW
TMOD1 Select Bit
0 0 : Timer mode
RW
MR0
Pulse Output Function
Select Bit
0 : Pulse is not output
(TAiOUT pin is a normal port pin)
1 : Pulse is output
RW
(TAiOUT pin is a pulse output pin)
MR1
MR2
Gate Function Select Bit
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 TAiIN pin
is low (1)
1 1 : Counts while input on the TAiIN pin RW
is high (1)
MR3
Set to "0" in timer mode
RW
TCK0
b7 b6
0 0 : f1 or f2
RW
Count Source Select Bit 0 1 : f8
TCK1
1 0 : f32
1 1 : fC32
RW
NOTE:
1.The port direction bit for the TAiIN pin is set to "0" (input mode).
Figure 13.7 TA0MR to TA4MR Registers in Timer Mode
Rev.2.00 Nov 28, 2005 page 119 of 378
REJ09B0124-0200