Timer A; Timer Mode - Renesas M16C/62P Hardware Manual

Renesas 16-bit single-chip microcomputer
Hide thumbs Also See for M16C/62P:
Table of Contents

Advertisement

M16C/62P Group (M16C/62P, M16C/62PT)
Timer Ai Mode Register (i=0 to 4)
b7
b6
b5
b4
Timer Ai Register (i= 0 to 4)
(b15)
b7
NOTES :
1. The register must be accessed in 16-bit units.
2. If the TAi register is set to "0000h," the counter does not work and timer Ai interrupt requests are not
generated either. Furthermore, if "pulse output" is selected, no pulses are output from the TAiOUT pin.
3. If the TAi register is set to "0000h," the pulse width modulator does not work, the output level on the
TAiOUT pin remains low, and timer Ai interrupt requests are not generated either. The same applies
when the 8 high-order bits of the timer TAi register are set to "00h" while operating as an 8-bit pulse
width modulator.
4. Use the MOV instruction to write to the TAi register.
5. The timer counts pulses from an external device or overflows or underflows in other timers.
Figure 15.4 TA0MR to TA4MR Registers and TA0 to TA4 Registers
R
e
. v
2
3 .
0
S
e
p
0
, 1
2
0
0
4
R
E
J
0
9
B
0
1
8
5
0 -
2
3
0
Z
b3
b2
b1
b0
Symbol
TA0MR to TA4MR
Bit
Symbol
TMOD0
TMOD1
MR0
MR1
MR2
MR3
TCK0
TCK1
(1)
(b8)
b0 b7
Mode
Timer
Divide the count source by n + 1 where n =
Mode
set value
Event
Divide the count source by FFFFh – n + 1
Counter
where n = set value when counting up or
Mode
by n + 1 when counting down
One-Shot
Divide the count source by n where n = set

Timer Mode

value and cause the timer to stop
Modify the pulse width as follows:
Pulse Width
PWM period: (2
Modulation
High level PWM pulse width: n / fj
Mode
where n = set value, fj = count source
(16-Bit PWM)
frequency
Pulse Width
Modify the pulse width as follows:
Modulation
PWM period: (2
Mode
High level PWM pulse width: (m + 1)n / fj
(8-Bit PWM)
where n = high-order address set value,
m = low-order address set value, fj =
count source frequency
page 123
f o
3
6
4
Address
0396h to 039Ah
Bit Name
b1 b0
Operation Mode Select Bit
0 0 : Timer mode
0 1 : Event counter mode
1 0 : One-shot timer mode
1 1 : Pulse width modulation
Function varies with each
operation mode
Count Source Select Bit
Function varies with each
operation mode
Symbol
Address
TA0
0387h, 0386h
b0
TA1
0389h, 0388h
TA2
038Bh, 038Ah
TA3
038Dh, 038Ch
TA4
038Fh, 038Eh
Function
(5)
16
– 1) / fj
8
– 1) x (m + 1)/ fj
After Reset
00h
Function
(PWM) mode
After Reset
Indeterminate
Indeterminate
Indeterminate
Indeterminate
Indeterminate
Setting Range
0000h to FFFFh
0000h to FFFFh
(2, 4)
0000h to FFFFh
(3, 4)
0000h to FFFEh
00h to FEh
(High-order address)
00h to FFh
(Low-order address)
(3, 4)
15. Timers
RW
RW
RW
RW
RW
RW
RW
RW
RW
RW
RW
RW
WO
WO
WO

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c/62pt

Table of Contents