21
PRELIMINARY
Notice: This is not a final specification.
Some parametric limits are subject to change.
MITSUBISHI MICROCOMPUTERS
M37736MHBXXXGP
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Fig. 21 Timer Aj mode register bit configuration when performing
two-phase pulse signal processing in event counter mode
Fig. 20 Two-phase pulse signal processing operation of timer A4
Fig. 19 Two-phase pulse signal processing operation of timer A2
Furthermore, in the event counter mode, whether to increment or
decrement the counter can also be determined by supplying two kinds
of pulses of which phases differ by 90
°
to timer A2, A3, or A4. There
are two types of two-phase pulse signal processing operations. One
uses timer A2 and the other uses timer A4. Timer A3 can select one
of these two operations with bit 7 of the timer A3 mode register. In
both processing operations, two kinds of pulses of which phases differ
by 90
°
are input to the TAj
OUT
(j = 2 to 4) pin and TAj
IN
pin respectively.
After the level of the TA2
OUT
pin changes from “L” to “H” with timer
A2 used, as shown in Figure 19, the count is incremented when a
rising edge is input to the TA2
IN
pin and the count is decremented
when the falling edge is input.
For timer A4, as shown in Figure 20, when a phase related pulse
with a rising edge input to the TA4
IN
pin is input after the level of
TA4
OUT
pin changes from “L” to “H”, the count is incremented at the
respective rising edge and falling edge of the TA4
OUT
pin and TA4
IN
pin. When a phase related pulse with a falling edge input to the TA4
OUT
pin is input after the level of TA4
IN
pin changes from “H” to “L”, the
count is decremented at the respective rising edge and falling edge
of the TA4
IN
pin and TA4
OUT
pin.
When performing this two-phase pulse signal processing, bits 0 and
4 of the timer Aj mode register must be set to “1” and bits 1, 2, 3, and
5 must be set to “0” as shown in Figure 21.
Bit 7 is used to select whether to perform two-phase pulse signal
processing for timer A3 in the same manner as timer A2 or as timer
A4. When this bit is “0”, two-phase pulse signal processing for timer
A3 is performed in the same manner as timer A2 and when it is “1”, it
is performed in the same manner as timer A4. This bit is ignored for
timers A2 and A4.
Note that bits 5, 6, and 7 of the up-down flag (address 44
16
) are the
two-phase pulse signal processing selection bits for timers A2, A3,
and A4, respectively.
Each timer operates in the normal event counter mode when the
corresponding bit is “0” and performs two-phase pulse signal
processing when it is “1”.
Count is started by setting the count start flag to “1”. Data write and
read are performed in the same way as for the normal event counter
mode. Note that the port direction register of the input port must be
set to the input mode because two-phase pulse signal is input. Also,
there can be no pulse output in this mode.
TA2
OUT
TA2
IN
Increment
count
Increment
count
Increment
count
Decrement
count
Decrement
count
Decrement
count
TA4
OUT
TA4
IN
Increment count at each edge
Decrement count at each edge
Increment count at each edge
Decrement count at each edge
Addresses
0 1 : Always “01” in event counter
mode
7
6
5 4
3
2 1
0
0
0
1
0 1 0 0 : Always “0100” when processing
two-phase pulse signal
Timer A2 mode register 58
16
Timer A3 mode register 59
16
Timer A4 mode register 5A
16
1
0
0
0 : Reload
1 : No reload
This bit is avilable for timer A3
0 : Two-phase pulse signal processing
in the same manner as timer A2
1 : Two-phase pulse signal processing
in the same manner as timer A4