Rev.2.00 Oct 16, 2006 page 26 of 354
REJ09B0340-0200
M30245 Group
2. Timer A
2.2.9 Operation of Timer A (one-shot timer mode)
Figure 2.2.20. Operation timing of one-shot mode
In one-shot timer mode, choose functions from those listed in Table 2.2.9. Operations of the circled items
are described below. Figure 2.2.20 shows the operation timing, and Figures 2.2.21 shows the set-up
procedure.
Operation
Note: j = i – 1, but j = 4 when i = 0; k = i + 1, but k = 0 when i = 4.
(1) Setting the one-shot start flag to “1” with the count start flag set to “1” causes the counter to
perform a down count on the count source. At this time, the TAi
OUT
pin outputs an “H” level.
(2) The instant the value of the counter becomes “0000
16
”, the TAi
OUT
pin outputs an “L” level,
and the counter reloads the content of the reload register and stops counting. At this time, the
timer Ai interrupt request bit goes to “1”.
(3) If a trigger occurs while a count is in progress, the counter reloads the value in the reload
register again and continues counting. The reload timing is in step with the next count source
input after the trigger.
(4) Setting the count start flag to “0” causes the counter to stop and to reload the content of the
reload register. Also, the TAi
OUT
pin outputs an “L” level. At this time, the timer Ai interrupt
request bit goes to “1”.
Item
Count source
Pulse output function
Count start condition
Set-up
O
O
O
Internal count source (f
1
/ f
8
/ f
32
/ fc
32
)
No pulses output
Pulses output
External trigger input (falling edge of input signal to the TAi
IN
pin)
External trigger input (rising edge of input signal to the TAi
IN
pin)
Timer overflow (TAj/TAk overflow)
Writing “1” to the one-shot start flag
Table 2.2.9. Choosed functions
FFFF
16
n
0001
16
Timer Ai interrupt
request bit
Counter content (hex)
n = reload register content
Reload
One-shot pulse output
from TAi
OUT
pin
“H”
1 / f
i
X (n)
“L”
Time
Reload
1 / f
i
X (n+1)
Write signal to
one-shot start flag
“1”
“0”
Count start flag
“1”
“0”
(1) Start count
Cleared to “0” when interrupt request is accepted, or cleared by software
(2) Stop count
(3) Start count
(4) Stop count
Start count
Reload
Set to “1” by software
Cleared to “0” by software
Summary of Contents for M16C FAMILY
Page 12: ...Chapter 1 Hardware...
Page 13: ...See M30245 group datasheet...
Page 14: ...Chapter 2 Peripheral Functions Usage...
Page 303: ...THIS PAGE IS BLANK FOR REASONS OF LAYOUT...
Page 304: ...Chapter 3 Examples of Peripheral Functions Applications...
Page 340: ...Chapter 4 External Buses...
Page 361: ...THIS PAGE IS BLANK FOR REASONS OF LAYOUT...
Page 362: ...Chapter 5 Standard Characteristics...