English
Language : 

M16C80 Datasheet, PDF (115/358 Pages) Renesas Technology Corp – RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/80 SERIES
M16C/80 Group
13. Timer A
(4) Pulse width modulation (PWM) mode
In this mode, the timer outputs pulses of a given width in succession. (See Table 13.5) In this mode, the counter
functions as either a 16-bit pulse width modulator or an 8-bit pulse width modulator. Figure 13.11 shows the timer
Ai mode register in pulse width modulation mode. Figure 13.12 shows the example of how a 16-bit pulse width
modulator operates. Figure 13.13 shows the example of how an 8-bit pulse width modulator operates.
Table 13.5 Timer specifications in pulse width modulation mode
Item
Specification
Count source
f1, f8, f32, fC32
Count operation
• The timer counts down (operating as an 8-bit or a 16-bit pulse width modulator)
• The timer reloads a new count at a rising edge of PWM pulse and continues counting
• The timer is not affected by a trigger that occurs when counting
16-bit PWM
• High level width
n / fi n : Set value
• Cycle time (216-1) / fi fixed
8-bit PWM
• High level width n (m+1) / fi n : values set to timer Ai register’s high-order address
• Cycle time (28-1) (m+1) / fi m:values set to timer Ai register’s low-order address
Count start condition
• External trigger is input
• The timer overflows
• The count start flag is set (= 1)
Count stop condition
• The count start flag is reset (= 0)
Interrupt request generation timing PWM pulse goes “L”
TAiIN pin function
Programmable I/O port or trigger input
TAiOUT pin function
Pulse output (TAiOUT output is selected by the corresponding function select
registers A and B)
Read from timer
When timer Ai register is read, it indicates an indeterminate value
Write to timer
• When not counting
Value written to timer Ai register is written to both reload register and counter
• When counting
Value written to timer Ai register is written to only reload register
(Transferred to counter at next reload time)
Timer Ai mode register
b7 b6 b5 b4 b3 b2 b1 b0
11
Symbol
Address
When reset
TAiMR(i=0 to 4) 035616 to 035A16 00000X002
Bit symbol
TMOD0
TMOD1
MR0
MR1
Bit name
Function
RW
Operation mode
select bit
b1 b0
1 1 : Pulse width modulaten (PWM) mode
This bit is invalid in M16C/80 series.
Port output control is set by the function select registers A and B.
––
External trigger select
bit (Note 1)
0: Falling edge of TAiIN pin's input signal (Note 2)
1: Rising edge of TAiIN pin's input signal (Note 2)
MR2
Trigger select bit
0: Count start flag is valid
1: Selected by event/trigger select bit
MR3
16/8-bit PWM mode
select bit
0: Functions as a 16-bit pulse width modulator
1: Functions as an 8-bit pulse width modulator
TCK0
TCK1
Count source select bit
b7 b6
0 0 : f1
0 1 : f8
1 0 : f32
1 1 : fC32
Note 1: Valid only when the TAiIN pin is selected by the event/trigger select bit
(addresses 034216 and 034316). If timer overflow is selected, this bit can be “1” or “0”.
Note 2: Set the corresponding function select register A to I/O port, and port direction
register to “0”.
Figure 13.11 Timer Ai mode register in pulse width modulation mode
Rev.1.00 Aug. 02, 2005 Page 104 of 329
REJ09B0187-0100