Timer A - 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 Timer A

Figure 13.3 shows a block diagram of the timer A. Figures 13.4 to 13.6 show the timer A-related registers.
The timer A supports the following four modes. Except in event counter mode, timers A0 to A4 all have the
same function. Use the TMOD1 to TMOD0 bits in the TAiMR register (i = 0 to 4) to select the desired mode.
• Timer mode:
• Event counter mode:
• One-shot timer mode:
• Pulse width modulation mode: The timer outputs pulses in a given width successively.
Select Clock source
TCK1 to TCK0
00
f1 or f2
01
f8
10
f32
11
fC32
Polarity
TAiIN
selection
TB2 overflow (1)
TAj overflow (1)
TAk overflow (1)
Pulse output
TAiOUT
TCK1 to TCK0, TMOD1 to TMOD0, MR2 to MR1: Bits in TAiMR register
TAiTGH to TAiTGL: Bits in ONSF register If i = 0, bits in TRGSR register if i = 1 to 4
TAiS: Bit in TABSR register
TAiUD: Bit in UDF register
i = 0 to 4
j = i - 1except j = 4 when i = 0
k = i + 1 except k = 0 when i = 4
NOTE:
1. Overflow or underflow
Figure 13.3 Timer A Block Diagram
Rev.2.00
Nov 28, 2005
REJ09B0124-0200
The timer counts an internal count source.
The timer counts pulses from an external device or overflows and
underflows of other timers.
The timer outputs a pulse only once before it reaches the minimum count "0000h."
Timer
: TMOD1 to TMOD0 = 00, MR2 = 0
: TMOD1 to TMOD0 = 10
One shot
Pulse width modulation : TMOD1 to TMOD0 = 11
Timer (gate function)
: TMOD1 to TMOD0 = 00, MR2 = 1
Event counter
: TMOD1 to TMOD0 = 01
00
01
10
To external trigger circuit
11
TAiTGH to TAiTGL
page 115 of 378
Select clock
TMOD1 to TMOD0,
MR2
TAiS
00
10
11
Decrement
01
TMOD1 to TMOD0
0
TAiUD
1
MR2
Toggle Flip-Flop
TAi
Timer A0
Timer A1
Timer A2
Timer A3
Timer A4
13. Timers
High-order Bits of Data Bus
Low-order Bits of Data Bus
Low-order
High-order
8 bits
8 bits
Reload Register
Counter
Increment/Decrement
Always counts down except
in event counter mode
Addresses
TAj
TAk
0387h - 0386h
Timer A4
Timer A1
0389h - 0388h
Timer A0
Timer A2
038Bh- 038Ah
Timer A1
Timer A3
038Dh- 038Ch
Timer A2
Timer A4
038Fh- 038Eh
Timer A3
Timer A0

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c/6nm

Table of Contents