deveopmen
Rev.B2 for proof reading
Timer A
Mitsubishi Microcomputers
M32C/83 group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
138
Note: This does not apply when the free-run function is selected.
(2) Event counter mode
In this mode, the timer counts an external signal or an internal timer
’
s overflow. Timers A0 and A1 can
count a single-phase external signal. Timers A2, A3, and A4 can count a single-phase and a two-phase
external signal. Table 1.14.2 lists timer specifications when counting a single-phase external signal.
Table 1.14.3 lists timer specifications when counting a two-phase external signal. Figure 1.14.8 shows
the timer Ai mode register in event counter mode.
Table 1.14.2. Timer specifications in event counter mode (when not processing two-phase pulse signal)
Item
Specification
Count source
External signals input to TAi
IN
pin (effective edge can be selected by software)
TB2 overflows or underflows, TAj overflows or underflows
Up count or down count can be selected by external signal or software
When the timer overflows or underflows, it reloads the reload register contents
before continuing counting
(Note)
1/ (FFFF
16
- n + 1) for up count
1/ (n + 1) for down count
n : Set value
Count start flag is set (= 1)
Count start flag is reset (= 0)
Count operation
Divide ratio
Count start condition
Count stop condition
Interrupt request generation timing
The timer overflows or underflows
TAi
IN
pin function
Programmable I/O port or count source input
TAi
OUT
pin function
Programmable I/O port, pulse output, or up/down count select input (Setting by corre-
sponding function select registers A, B and C)
Read from timer
Count value can be read out by reading timer Ai register
Write to timer
When counting stopped
When a value is written to timer Ai register, it is written to both reload register and
counter
When counting in progress
When a value is written to timer Ai register, it is written to only reload register
(Transferred to counter at next reload time)
Select function
Free-run count function
Even when the timer overflows or underflows, the reload register content is not
reloaded to it
Pulse output function
Each time the timer overflows or underflows, the TAi
OUT
pin
’
s polarity is reversed