![](http://datasheet.mmic.net.cn/110000/M30201F6-SP_datasheet_3496102/M30201F6-SP_253.png)
Timer X
Mitsubishi microcomputers
M30201 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
241
Figure 2.4.21. Set-up procedure of pulse width modulation mode, 16-bit PWM mode selected
Setting PWM pulse's “H” level width
Can be set to 000016 to FFFE16
b7
b0
(b15)
(b8)
b7
b0
Timer X0 register [Address 038916, 038816]TX0
Timer X1 register [Address 038B16, 038A16]TX1
Timer X2 register [Address 038D16, 038C16]TX2
Start count
Setting clock prescaler reset flag
(This function is effective when fC32 is selected as the count source. Reset the prescaler for generating fC32 by dividing the XCIN by 32.)
Clock prescaler reset flag [Address 038116]
CPSRF
Clock prescaler reset flag
0 : No effect
1 : Prescaler is reset (When read, the value is “0”)
b7
b0
1 (Must always be “1” in PWM mode)
Selecting PWM mode and functions
Timer Xi mode register (i = 0 to 2) [Address 039716 to 039916]
TXiMR (i = 0 to 2)
Invalid in event counter mode
Can be “0” or “1”.
Selection of PWM mode
b7
b0
11
1
16/8-bit PWM mode select bit
0 : Functions as a 16-bit pulse width modulator
b7 b6
Count source select bit
0 0 : f1
0 1 : f8
1 0 : f32
1 1 : fC32
Trigger select bit
1 : Selected by event/trigger select register
0
Count source period
f(XIN) : 10MHZ
f(XcIN) : 32.768kHZ
b7 b6
Count
source
100ns
800ns
3.2s
976.56s
00
01
10
11
f1
f8
f32
fC32
Note: Set the corresponding port direction register which outputs the pulse to “1” (output mode).
Clearing timer Xi interrupt request bit
Timer Xi interrupt control register (i = 0 to 2) [Address 005616 to 005816]
TXiIC (i = 0 to 2)
Interrupt request bit
b7
b0
0
Refer to 'Precaution for Timer X (pulse width modulation mode)'
Setting trigger select register
Trigger select register [Address 038316]
TRGSR
b7
b0
Timer X0 event/trigger select bit
0 1 : TB1 overflow is selected
1 0 : TA0 overflow is selected
1 1 : TX1 overflow is selected
b3 b2
Timer X1 event/trigger select bit
0 1 : TB1 overflow is selected
1 0 : TX0 overflow is selected
1 1 : TX2 overflow is selected
b5 b4
Timer X1 event/trigger select bit
0 1 : TB1 overflow is selected
1 0 : TX1 overflow is selected
1 1 : TA0 overflow is selected
b7 b6
Setting count starts flag
Count start flag [Address 038016]
TABSR
Timer X0 count start flag
b7
b0
Timer X1 count start flag
Timer X2 count start flag