R01UH0136EJ0210 Rev.2.10
Page 269 of 800
Jul 31, 2012
M16C/64A Group
17. Timer A
17.3.2
Timer Mode
In timer mode, the timer counts an internally generated count source. Table 17.6 lists Timer Mode
Specifications, Table 17.7 lists Registers and the Setting in Timer Mode, and Figure 17.5 shows an
Operation Example in Timer Mode.
Table 17.6
Timer Mode Specifications
Item
Specification
Count source
f1TIMAB, f2TIMAB, f8TIMAB, f32TIMAB, f64TIMAB, fOCO-S, fC32
Count operation
•
Decrement
•
When the timer underflows, it reloads the reload register value and
continues counting.
Counter cycles
n: set value of TAi register, 0000h to FFFFh
fj: frequency of count source
Count start condition
Set the TAiS bit in the TABSR register to 1 (start counting).
Count stop condition
Set the TAiS bit to 0 (stop counting).
Interrupt request generation
timing
Timer underflow
TAiIN pin function
I/O port or gate input
TAiOUT pin function
I/O port or pulse output
Read from timer
The count value can be read by reading the TAi register.
Write to timer
•
When not counting
Value written to the TAi register is written to both the reload register and counter.
•
When counting
Value written to the TAi register is only written to reload register
(transferred to counter when reloaded next).
Selectable functions
•
Gate function
Counting can be started and stopped by an input signal to the TAiIN pin.
•
Pulse output function
Whenever the timer underflows, the output polarity of the TAiOUT pin is inverted.
When the TAiS bit is set to 0 (stop counting), the pin outputs a low-level signal.
•
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
1
+
(
)
fj
------------------
Содержание M16C/60 Series
Страница 853: ...M16C 64A Group R01UH0136EJ0210...