R01UH0136EJ0210 Rev.2.10
Page 282 of 800
Jul 31, 2012
M16C/64A Group
17. Timer A
17.3.5
One-Shot Timer Mode
In one-shot timer mode, the timer is activated only once per trigger. When the trigger occurs, the timer
starts and continues operating for a given period. Table 17.12 lists One-Shot Timer Mode
Specifications. Table 17.13 lists Registers and the Setting in One-Shot Timer Mode. Figure 17.10
shows Operation Example in One-Shot Timer Mode.
Table 17.12
One-Shot Timer Mode Specifications
Item
Specification
Count source
f1TIMAB, f2TIMAB, f8TIMAB, f32TIMAB, f64TIMAB, fOCO-S, fC32
Count operations
•
Decrement
•
When the timer counter reaches 0000h, it stops running after the reload
register value is reloaded
•
When a trigger occurs while counting, the reload register value is reloaded into
the counter to continue counting
Pulse width
n: Set value of the TAi register, 0000h to FFFFh
However, the counter does not run if 0000h is set.
fj: Count source frequency
Count start condition
The TAiS bit in the TABSR register is 1 (start counting) and one of the following
triggers occurs:
•
External trigger input from the TAiIN pin
•
Timer B2 overflow or underflow
•
Timer Aj overflow or underflow (j = i - 1, except j = 4 if i = 0)
•
Timer Ak overflow or underflow (k = i + 1, except k = 0 if i = 4)
•
The TAiOS bit in the ONSF register is set to 1 (one-shot timer start).
Count stop condition
•
When the counter is reloaded after reaching 0000h
•
The TAiS bit is set to 0 (stop counting)
Interrupt request
generation timing
When the counter reaches 0000h
TAiIN pin function
I/O port or trigger input
TAiOUT pin function
I/O port or pulse output
Read from timer
An undefined value is read when reading the TAi register.
Write to timer
•
When not counting and until the first count source is input after counting starts,
the value written to the TAi register is written to both the reload register and
counter.
•
When counting (after the first count source input), the value written to the TAi
register is written to only the reload register (transferred to the counter when
reloaded next time).
Selectable functions
•
Pulse output function
The timer outputs a low-level signal when not counting and a high-level signal
when counting.
•
Output polarity control
The output polarity of the TAiOUT pin is inverted. (While the TAiS bit is set to 0
(stop counting), a high-level signal is output.)
i = 0 to 4
n
fj
---
n
Содержание M16C/60 Series
Страница 853: ...M16C 64A Group R01UH0136EJ0210...