
Rev.2.10 Apr 14, 2006 page 127 of 378
REJ09B0124-0210
M16C/6N Group (M16C/6NK, M16C/6NM) 13. Timers
13.1.4 Pulse Width Modulation (PWM) Mode
In Pulse Width Modulation mode, the timer outputs pulses of a given width in succession. The counter
functions as either 16-bit pulse width modulator or 8-bit pulse width modulator.
Table 13.5 lists the Pulse Width Modulation Mode Specifications. Figure 13.12 shows Registers TA0MR
to TA4MR in Pulse Width Modulation Mode. Figures 13.13 and 13.14 show an Example of 16-bit Pulse
Width Modulator Operation and 8-bit Pulse Width Modulator Operation.
Table 13.5 Pulse Width Modulation Mode Specifications
Item Specification
Count source f1, f2, f8, f32, fC32
Count operation • Down-count (operating as an 8-bit or a 16-bit pulse width modulator)
• The timer reloads a new value at a rising edge of PWM pulse and continues counting
• The timer is not affected by a trigger that occurs during counting
16-bit PWM • High level width n / fj n : set value of the TAi register
• Cycle time (2
16
-1) / fj fixed fj : count source frequency (f1, f2, f8, f32, fC32)
8-bit PWM • High level width n ✕ (m+1) / fj n :
set value of the TAi register high-order address
• Cycle time (2
8
-1) ✕ (m+1) / fj m :
set value of the TAi register low-order address
Count start condition • The TAiS bit in the TABSR register is set to 1 (count starts)
• The TAiS bit = 1 and external trigger input from the TAiIN pin
• The TAiS bit = 1 and one of the following external triggers occurs
Timer B2 overflow or underflow,
Timer Aj overflow or underflow,
Timer Ak overflow or underflow
Count stop condition The TAiS bit is set to 0 (count stops)
Interrupt request generation timing
On the falling edge of the PWM pulse
TAiIN pin function I/O port or trigger input
TAiOUT pin function Pulse output
Read from timer An undefined value is 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)
i = 0 to 4
j = i - 1, except j = 4 if i = 0
k = i + 1, except k = 0 if i = 4
Comentarios a estos manuales