![](http://datasheet.mmic.net.cn/110000/M30201F6-SP_datasheet_3496102/M30201F6-SP_210.png)
Timer A
Mitsubishi microcomputers
M30201 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
198
In pulse width modulation mode, choose functions from those listed in Table 2.2.11. Operations of the
circled items are described below. Figure 2.2.24 shows the operation timing, and Figure 2.2.25 shows the
set-up procedure.
2.2.11 Operation of Timer A (pulse width modulation mode, 16-bit PWM mode selected)
Figure 2.2.24. Operation timing of pulse width modulation mode, 16-bit PWM mode selected
Item
Count source
PWM mode
Count start condition
Set-up
O
Internal count source (f1 / f8 / f32 / fc32)
16-bit PWM
8-bit PWM
External trigger input (falling edge of input signal to the TA0IN pin)
External trigger input (rising edge of input signal to the TA0IN pin)
Timer overflow (TB1/TX0/TX2 overflow)
Table 2.2.11. Choosed functions
(1) If the TA0IN pin input level changes from “L” to “H” with the count start flag set to “1”, the
counter performs a down count on the count source. Also, the TA0OUT pin outputs an “H” level.
(2) The TA0OUT pin output level changes from “H” to “L” when a set time period elapses. At this
time, the timer A0 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
TA0OUT outputs an “L” level.
PWM pulse cycle is (216 -1)/fi, whereas H level duration is n/fi. However, when “000016” is set
for 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 “FFFF16” is set for 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
Count source
TA0IN pin
input signal
PWM pulse output
from TA0OUT pin
Timer A0 interrupt
request bit
Count start flag
1 / fi X (2
–1)
16
Conditions: Reload register = 000316, external trigger (rising edge of TA0IN pin input signal) is selected
Trigger is not generated by this signal
“H”
“L”
“1”
“0”
Cleared to “0” when interrupt request is
accepted, or cleared by software
1 / fi X n
“1”
“0”
Set to “1” by software
(1) Start count
(2) Output level “H” to “L”
Note: n = 000016 to FFFE16
(3) One period is complete
(4) Stop count
Cleared to “0”
by software