Timer A (Timer Mode); Timer A (Event Counter Mode); Timer A (One-Shot Timer Mode) - Renesas M16C Series User Manual

16-bit single-chip microcomputer
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

M30240 Group
1.3.1.9 Stop Mode and Wait Mode
When returning from stop mode by hardware reset, RESET pin must be set to "L" level until main clock
oscillation is stabilized.
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 f
as the internal clock, switch it to f(X
SYN
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 "FFFF
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 "FFFF
or "0000
" by overflow. Reading the Timer Ai register after setting a value in the Timer Ai register with
16
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 0000
•If counting down, rewrite FFFF
• 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.
Rev.1.00 Sep 24, 2003 Page 120 of 360
) before entering stop mode.
IN
16.
16.
Precautions
". Reading the Tim-
16
" by underflow
16

Advertisement

Table of Contents
loading

Table of Contents