
Under
development
Tentative Specifications REV.C1
Specifications in this manual are tentative and subject to change.
Mitsubishi microcomputers
M30100/M30101/M30102 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer
61
Timer X has five operation modes that can be selected by setting the Timer X Mode Register.
(1) Timer mode
Prescaler X counts the selected count source and each time the count clock is applied, the prescaler
has its content decremented by one. After reaching “0016,” prescaler X underflows at the next count
clock and is reloaded with the value transferred from the prescaler-X reload register and starts count-
ing over again. The divide-by ratio of prescaler X is 1 / (n + 1) where n = set value of prescaler X.
Timer X has its content decremented by one each time an underflow signal is received from prescaler
X. After reaching “0016,” timer X underflows at the next count clock and is reloaded with the value
transferred from the timer-X reload register and starts counting over again. The divide-by ratio of timer
X is 1 / (m + 1) where m = set value of Timer X. Therefore, assuming n = set value of prescaler X and
m = set value of timer X, the divide-by ratio of timer X is 1 / ((n + 1) x (m + 1)).
(2) Pulse output mode
In pulse output mode, the microcomputer outputs from the CNTR0 pin a waveform whose polarity is
inverted each time timer X underflows. In the pulse output mode, said output pin is always directed for
output regardless of how the direction register for the port P17 is set.
The output level on the CNTR0 pin can be selected with the CNTR0 pin polarity select bit. When the
CNTR0 pin polarity select bit = 0, the first data output from the CNTR0 pin is high. When the CNTR0
pin polarity select bit = 1, the first data output from the CNTR0 pin is low.
Also, by setting the P30/TXOUT output enable bit to “1”, it is possible to output from the TXOUT pin an
inverted waveform of the pulse that is output from the CNTR0 pin.
When setting the P30/TXOUT output enable bit to “1”, said output pin is always directed for output
regardless of how the direction register for the port P30 is set.
(3) Event counter mode
In event counter mode, timer X operates in the same way as in timer mode, except that the signal fed
to the P17/CNTR0 pin is the count source. The active edge on CNTR0 pin input can be selected to be
the rising or the falling edge with the CNTR0 polarity select bit.
(4) Pulse width measure mode
This mode is used to measure the pulse width of the signal fed to the P17/CNTR0 pin. In pulse width
measure mode, timer X is controlled to run or stop by the input signal level on the CNTR0 pin. The
value of the timer X is not reloaded until the timer underflows. When the timer X underflows, a timer X
interrupt is generated.
When the CNTR0 polarity select bit = 0, timer X counts the signal selected with the timer X count
source select bit while the CNTR0 pin input is high, and stops counting when the CNTR0 pin input is
low. Conversely, when the CNTR0 polarity select bit = 1, timer X counts the signal selected with the
timer X count source select bit while the CNTR0 pin input is low, and stops counting when the CNTR0
pin input is high.