![](http://datasheet.mmic.net.cn/30000/M30102M6T-XXXFP_datasheet_2358636/M30102M6T-XXXFP_68.png)
Under
development
Tentative Specifications REV.E1
Specifications in this manual are tentative and subject to change.
Mitsubishi microcomputers
M30100/M30102 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer X
65
(2) Pulse output mode
In this mode, the timer counts an internally generated count source, and outputs from the CNTR0 pin
a pulse whose polarity is inverted each time the timer underflows. (See Table 1.14.4) Figure 1.14.7
shows Timer X mode register in pulse output mode.
Item
Specification
Count source
f1, f8, f32, fC32
Count operation
Down count
When the timer underflows, it reloads the reload register contents before continuing counting
Divide ratio
1/(n+1)/(m+1) n : Set value of Prescaler X, m: Set value of Timer X
Count start condition
Count start flag is set (=1)
Count stop condition
Count start flag is reset (=0)
Interrupt request generation timing When Timer X underflows [Timer X interruption]
Rising (R0EDG=0) or falling (R0EDG=1) of CNTR0 output [CNTR0 interruption] (Note)
CNTR0 pin function
Pulse output
TXOUT pin function
Programmable I/O port or pulse output (Inverted waveform of the pulse output from the
CNTR0 pin)
Read from timer
Count value can be read out by reading Timer X register.
Same applies to Prescaler X register.
Write to timer
When a value is written to Timer X register, it is written to both reload register and counter.
Same applies to Prescaler X register.
Select function
Pulse output function
Each time the timer underflows, the TXOUT pin’s polarity is reversed
CNTR0 polarity switching function
The polarity level at starting of pulse output can be selected to be "High" or "Low" with software.
Note: When setting the timer X mode register to pulse output mode, the CNTR0 interrupt request bit becomes "1".
Thus, when using an CNTR0 interrupt, the CNTR0 interrupt request bit must be set to "0" after setting the timer
X mode register.
Table 1.14.4. Specifications of pulse output mode
Timer X mode register
Symbol
Address
When reset
TXMR
008B16
000000002
Bit name
Function
Bit symbol
W
R
b7
b6 b5
b4
b3
b2
b1 b0
0 1 : Pulse output mode
b1 b0
TXMOD2
TXS
TXMOD1
R0EDG
TXMOD0
TXOCNT
CNTR0 polarity
switching bit
Operation mode
select bit 0, 1
Note 1: In the pulse output mode, the direction register of port P17 must be set to input.
Note 2: Output is set regardless of the setting of the direction register of port P30.
Note 3: This bit should rewrite with inhibiting the CNTR0 interrupt.
0: Output starts at "H" (Interrupt at rising edge)
1: Output starts at "L" (Interrupt at falling edge)
Timer X count
start flag
0 : Stops counting
1 : Starts counting
P30/TXOUT
select bit
0 : Port P30
1 : TXOUT output
0 : Set to "0" in pulse output mode
(Note 1)
(Note 2)
0
1
(Note 3)
Invalid in pulse output mode.
When write, set "0". When read, this contents is indeteminate.
TXEDG
TXUND
Invalid in pulse output mode.
When write, set "0". When read, this contents is indeteminate.
Figure 1.14.7. Timer X mode register in pulse output mode