Pulse Width Modulation Mode - 8-Bit Pwm Mode Selected - Renesas M16C Series User Manual

16-bit single-chip microcomputer
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

M30240 Group

2.2.2.11 Pulse width modulation mode - 8-bit PWM mode selected

In pulse width modulation mode, select functions from those listed in Table 2.12 . An example using the
indicated options is described below. Figure 2.27 shows the operation timing, and Figure 2.28 shows
the set-up procedure.
Table 2.12:
Timer A pulse width modulation mode 8-bit PWM mode selected
Item
Count source
O
PWM mode
O
O
Count start condition
Note:
j = i - 1, but j = 4 when i = 0; k = i + 1 when i = 4
Operation
(1) If the TAi
pin input level changes from "H" to "L" with the count start flag set to "1", the counter
IN
performs a down count on the count source. Also, the TAi
(2) The TAi
pin output level changes from "H" to "L" when a set time period elapses. At this time,
OUT
the Timer Ai interrupt request bit goes to "1".
(3) The counter reloads the content of the reload register every time PWM pulses are output for one
cycle, and continues counting.
(4) Setting the count start flag to "0" causes the counter to hold its value and to stop. Also, the TAi
pin outputs an "L" level.
Notes
• The period of PWM pulses becomes (m + 1) X (2
X (m + 1) / fi. If "00
modulator does not work, and the TAi
(fi: frequency of the count source f1, f8, f32; n: value of the timer)
• When a trigger is generated, the TAiout pin outputs "L" level of same amplitude as "H" level of the
set PWM pulse, after which it starts PWM pulse output.
Conditions:
Count source (Note 1)
Count start flag
TA
pin input
iIN
Underflow signal of 8-bit
prescaler (Note 2)
PWM pulse output from
TA
pin
iOUT
Timer Ai interrupt
request bit
Figure 2.27: Operation timing of pulse width modulation mode, with 8-bit PWM mode selected
Rev.1.00 Sep 24, 2003 Page 167 of 360
Internal count source (f1/f8/f32)
16-bit PWM
8-bit PWM
External trigger input (falling edge of input signal to the TAi
External trigger input (rising edge of input signal to the TAi
Timer overflow (TB2/TAj/TAk overflow)
" is set in the eight higher-order bits of the Timer Ai register, the pulse width
16
pin output level remains at "L".
OUT
Reload register high-order 8 bits = 02
16
Reload register low-order 8 bits = 02
16
External trigger (falling edge of TAi
pin input signal) is selected
IN
"1"
"0"
(1) Start count
(2) Output level "H" to "L"
"H"
"L"
1 / f
"H"
"L"
"H"
"L"
"1"
"0"
Note 1: The 8-bit prescaler counts the count source.
Note 2: The 8-bit pulse width modulator counts the 8-bit prescaler's underflow signal.
Note 3: m = 00
to FE
; n = 00
to FE
16
16
16
16
Set-up
IN
IN
pin outputs an "H" level.
OUT
8
– 1) / fi, and the "H" level pulse width becomes n
8
1 / f
X (m + 1) X (2
1)
i
(3)
One period is
complete
X (m+1)
i
1 / f
X (m + 1) X n
i
Cleared to "0" when interrupt request
is accepted, or cleared by software
.
Timer A
pin)
pin)
OUT
(4) Stop count

Advertisement

Table of Contents
loading

Table of Contents