![](http://datasheet.mmic.net.cn/110000/M30201F6-SP_datasheet_3496102/M30201F6-SP_254.png)
Timer X
Mitsubishi microcomputers
M30201 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
242
2.4.11 Operation of Timer X (pulse width modulation mode, 8-bit PWM mode selected)
Figure 2.4.22. Operation timing of pulse width modulation mode, with 8-bit PWM mode selected
In pulse width modulation mode, choose functions from those listed in Table 2.4.10. Operations of the
circled items are described below. Figure 2.4.22 shows the operation timing, and Figure 2.4.22 shows the
set-up procedure.
Table 2.4.10. Choosed functions
(1) Selected timer overflow is generated with the count start flag set to “1”, the counter performs a
down count on the count source. Also, the TXiINOUT pin outputs an “H” level.
(2) The TXiINOUT pin output level changes from “H” to “L” when a set time period elapses. At this
time, the timer Xi 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
TXiOUT pin outputs an “L” level.
PWM pulse cycle is (m + 1( x (28 -1)/fi, whereas “H” level duration is n x (m + 1)/fi. However,
when “0016” is set for the significant 8 bits of the timer A0 register, the PWM output is “L” level
for the entire period, and an interrupt request is generated for every PWM output cycle. Also,
when “FF16” is set for the significant 8 bits of the timer A0 register, the PWM output is “H” level
for the entire period, and an interrupt request is generated for every PWM output cycle.
(fi: Count source frequency f1, f8, f32, fC32 n: Timer value)
Operation
Note
Item
Count source
PWM mode
Count start condition
Set-up
O
Internal count source (f1 / f8 / f32 / fc32)
16-bit PWM
8-bit PWM
Timer overflow (TB1/TA0/TXi overflow)
Conditions:Reload register high-order 8 bits = 0216
Reload register low-order 8 bits = 0216
When timer overflow is selected in trigger
1 / fi X (m + 1) X (2 – 1)
8
1 / fi X (m + 1) X n
1 / fi X (m+1)
Count source (Note 1)
Interrupt request bit
of timer becoming
trigger
Underflow signal of 8
-bit prescaler (Note 2)
PWM pulse output
from TXiINOUT pin
“H”
“L”
Timer Xi interrupt
request bit
“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 = 0016 to FF16; n = 0016 to FF16.
Count start flag
“1”
“0”
(1) Start count
(2) Output level “H” to “L”
Cleared to “0” when interrupt request is accepted, or cleared by software
(3) One period is
complete
(4) Stop count
Cleared to “0” when interrupt request is accepted, or cleared by software