Timer Mode - Renesas M16C/6NK Hardware Manual

16-bit single-chip microcomputer m16c family / m16c/60 series
Table of Contents

Advertisement

Under development
This document is under development and its contents are subject to change.
M16C/6N Group (M16C/6NK, M16C/6NM)

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
Count Source
Count Operation
Divide Ratio
Count Start Condition
Count Stop Condition
Interrupt Request Generation Timing Timer underflow
TAiIN Pin Function
TAiOUT Pin Function
Read from Timer
Write to Timer
Select Function
i = 0 to 4
Timer Ai Mode Register (i = 0 to 4)
b7
b6
b5
b4
b3
0
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
REJ09B0124-0200
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 the TAi register
Set the TAiS bit in the TABSR register to "1" (start counting)
Set the TAiS bit to "0" (stop counting)
I/O port or gate input
I/O port or pulse output
Count value can be read by reading the TAi register
• 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)
• 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.
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
page 119 of 378
Specification
Address
After Reset
0396h to 039Ah
00h
Bit Name
b1 b0
0 0 : Timer mode
0 : Pulse is not output
(TAiOUT pin is a normal port pin)
1 : Pulse is output
(TAiOUT pin is a pulse output pin)
b4 b3
0 0 :
Gate function not available
}
0 1 :
(TAiIN pin functions as I/O port)
1 0 : Counts while input on the TAiIN pin
(1)
is low
1 1 : Counts while input on the TAiIN pin
is high
b7 b6
0 0 : f1 or f2
0 1 : f8
1 0 : f32
1 1 : fC32
0000h to FFFFh
Function
RW
RW
RW
RW
RW
RW
(1)
RW
RW
RW
13. Timers

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c/6nm

Table of Contents