English
Language : 

M16C30P_07 Datasheet, PDF (117/317 Pages) Renesas Technology Corp – 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/30 SERIES
M16C/30P Group
14. Timers
14.1.2 Event Counter Mode
In event counter mode, the timer counts pulses from an external device or overflows and underflows of other
timers. Timer A2 can count two-phase external signals. Table 14.2 lists Specifications in Event Counter Mode
(when not processing two-phase pulse signal). Figure 14.9 shows TAiMR Register in Event Counter Mode (when
not using two-phase pulse signal processing).
Table 14.2 Specifications in Event Counter Mode (when not processing two-phase pulse signal)
Item
Specification
Count Source
• External signals input to TAiIN pin (i=0 to 2) (effective edge can be selected in
program)
• Timer B2 overflows or underflows,
Timer Aj (j=i-1, however, do not set when i=0) overflows or underflows,
Timer Ak (k=i+1, however, do not set when i=2) overflows or underflows
Count Operation
• Up-count or down-count can be selected by external signal or program
• When the timer overflows or underflows, it reloads the reload register contents
and continues counting. When operating in free-running mode, the timer
continues counting without reloading.
Divided Ratio
1/ (FFFFh - n + 1) for up-count
1/ (n + 1) for down-count n : set value of TAi register 0000h to FFFFh
Count Start Condition Set TAiS bit in the TABSR register to “1” (= start counting)
Count Stop Condition Set TAiS bit to “0” (= stop counting)
Interrupt Request
Generation Timing
Timer overflow or underflow
TAiIN Pin Function
I/O port or count source input
TAiOUT Pin Function I/O port, pulse output, or up/down-count select input
Read from Timer
Count value can be read by reading TAi register
Write to Timer
• When not counting and until the 1st count source is input after counting start
Value written to TAi register is written to both reload register and counter
• When counting (after 1st count source input)
Value written to TAi register is written to only reload register
(Transferred to counter when reloaded next)
Select Function
• Free-run count function
Even when the timer overflows or underflows, the reload register content is
not reloaded to it
• Pulse output function
Whenever the timer underflows or underflows, the output polarity of TAiOUT
pin is inverted. When TAiS bit is set to “0” (stop counting), the pin outputs a
low.
Rev.1.22 Mar 29, 2007 Page 101 of 291
REJ09B0179-0122