16
MITSUBISHI MICROCOMPUTERS
M37702M2AXXXFP, M37702M2BXXXFP
M37702S1AFP, M37702S1BFP
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
When bit 2 of the timer Ai mode register is “1”, the output is gener-
ated from TAi
OUT
pin. The output is toggled each time the contents
of the counter reaches to 0000
16
. When the contents of the count
start flag is “0”, “L” is output from TAi
OUT
pin.
When bit 2 is “0”, TAi
OUT
can be used as a normal port pin. When
bit 4 is “0”, TAi
IN
can be used as a normal port pin. When bit 4 is
“1”, counting is performed only while the input signal from the
TAi
IN
pin is “H” or “L” as shown in Figure 14. Therefore, this can
be used to measure the pulse width of the TAi
IN
input signal.
Whether to count while the input signal is “H” or while it is “L” is
determined by bit 3. If bit 3 is “1”, counting is performed while the
TAi
IN
pin input signal is “H” and if bit 3 is “0”, counting is performed
while it is “L”.
Note that the duration of “H” or “L” on the TAi
IN
pin must be two or
more cycles of the timer count source.
When data is written to timer Ai register with timer Ai halted, the
same data is also written to the reload register and the counter.
When data is written to timer Ai which is busy, the data is written to
the reload register, but not to the counter. The counter is reloaded
with new data from the reload register at the next reload timer. The
contents of the counter can be read at any time.
When the value set in the timer Ai register is n, the timer frequency
dividing ratio is 1/(n + 1).
Fig. 12 Timer Ai mode register bit configuration during timer mode
7
0
0
0 : Always “00” in timer mode
0
0 : No pulse output (TAi
OUT
is normal port pin)
1 : Pulse output
0
: No gate function (TAi
IN
is normal port pin)
1
0 : Count only while TAi
IN
input is “L”
1
1 : Count only while TAi
IN
input is “H”
6
2
3
4
5
1
0
0
0 : Always “0” in timer mode
Clock source selection bit
0
0 : Select f
2
0
1 : Select f
16
1
0 : Select f
64
1
1 : Select f
512
Timer A0 mode register 56
16
Timer A1 mode register 57
16
Timer A2 mode register 58
16
Timer A3 mode register 59
16
Timer A4 mode register 5A
16
Addresses