Timer A
M30240 Group
Rev.1.00 Sep 24, 2003 Page 170 of 360
Figure 2.30: Reading Timer Ai register in Event Counter mode
Figure 2.31: Standard 2-phase pulses
2.2.3.3 One-shot timer mode
(1) At reset, the count start flag is set to “0”. Set a value in the Timer Ai register, then set the flag to “1”.
(2) Setting the count start flag to “0” while the count is in progress causes the following:
• The counter stops counting and the contents of the reload register is reloaded.
• The TAiOUT pin outputs “L” level.
• The interrupt request is generated and the Timer Ai interrupt request bit goes to “1”.
(3) The output from the one-shot timer synchronizes with the count source generated internally.
Therefore, when an external trigger has been selected, a delay of one cycle of the maximum count
source occurs between the trigger input to the TAiIN pin and the one-shot timer output (See Figure 2.32).
(4) The Timer Ai interrupt request bit goes to “1” if the timer's operation mode is set using any of the
following procedures:
• 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.
Therefore, to use the Timer Ai interrupt, set the Timer Ai interrupt request bit to “0” after the changes
listed above have been made.
(5) If a trigger occurs while a count is in progress, after the counter performs one down count following
the reoccurrence of a trigger, the reload register contents are reloaded, and the count continues. To
generate a trigger while a count is in progress, generate the second trigger at least one cycle of the
timer's count source after the previous trigger occurred.
210
n
n – 1
Counter value
(Hex.)
210
FFFF
Read value
(Hex.)
Reload
Time
n = reload register content
(1) Down count
FFFD
FFFE FFFF
nn + 1
Counter value
(Hex.)
FFFD FFFE FFFF
0000
n + 1
Read value
(Hex.)
Reload
Time
n = reload register content
(2) Up count
n – 1
T1
T2 T3
TA 2 OUT
TA 3 OUT
TA 4 OUT
TA 2 IN
TA 3 IN
TA 4 IN
T1
(Min.)
T2, T3
(Min.)
Vcc = 5V, f(X
IN) = 12MHz
800ns 200ns