
120
Mitsubishi microcomputers
M30240 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Specifications REV. G
Specifications in this manual are tentative and subject to change
Precautions
When entering either wait or stop mode, you must first enable any interrupts you want to cancel the
wait or stop. Also, make sure to disable any interrupts that you don’t want to cancel the wait or stop.
If only hardware reset or NMI interrupts are desired to cancel wait or stop, all other interrupt priority
levels should be set to “0”
If using fSYN as the internal clock, switch it to f(XIN) before entering stop mode.
When switching to either wait or stop mode, the WAIT instruction or the instruction that sets the all
clock stop bit to “1” are prefetched within the instruction queue before the program stops. Put at least
four NOPs in succession after the WAIT instruction or after the instruction that sets the all clock stop
control bit to “1.”
1.3.1.10 Timer A (Timer mode)
Reading the Timer Ai register while a count is in progress allows reading, with arbitrary timing, the val-
ue of the counter. Reading the Timer Ai register with the reload timing gets “FFFF16”. Reading the Tim-
er Ai register after setting a value in the Timer Ai register with a count halted but before the counter
starts counting gets a proper value.
1.3.1.11 Timer A (Event counter mode)
1. Reading the Timer Ai register while a count is in progress allows reading, with arbitrary timing, the
value of the counter. Reading the Timer Ai register with the reload timing gets “FFFF16” by underflow
or “000016” by overflow. Reading the Timer Ai register after setting a value in the Timer Ai register with
a count halted but before the counter starts counting gets a proper value.
2. When counting has stopped in free-run type, set the timer again.
3. When using Free-run type, the timer’s register contents may be undefined when counting starts. Set
the timer value immediately after counting has started.
When the up/down count is not switched:
Enable the reload function and set a value to the timer register before counting starts.
Rewrite the value to the timer register immediately after counting has started. (This is the same operation
as free-run type.)
If counting up, rewrite 000016.
If counting down, rewrite FFFF16.
When the up/down count is switched:
Use the reload type until the first count pulse is input.
Switch to free-run type afterwards.
1.3.1.12 Timer A (One-shot Timer mode)
1. Setting the count start flag to “0” while the count is in progress causes:
The counter to stop counting
The contents of the reload register are reloaded
The TAiOUT pin outputs “L” level
The interrupt request is generated
2. Timer Ai interrupt request bit goes to “1” if the operation mode is set by:
Selecting one-shot timer mode after reset
Changing operation mode from timer mode to one-shot timer mode
Changing operation mode from event counter mode to one-shot timer mode
Note: To use Timer Ai interrupt request bit, clear the Timer Ai interrupt request bit to “0” after these
changes have been made.