Event Counter Mode - Renesas M16C FAMILY series Hardware Manual

16-bit single-chip microcomputer
Hide thumbs Also See for M16C FAMILY series:
Table of Contents

Advertisement

M
1
6
C
2 /
8
G
o r
u
p
(
M
1
6
C

12.1.2 Event Counter Mode

In event counter mode, the timer counts pulses from an external device or overflows and underflows of
other timers. Timers A2, A3 and A4 can count two-phase external signals. Table 12.2 lists specifications
in event counter mode (when not processing two-phase pulse signal). Table 12.3 lists specifications in
event counter mode (when processing two-phase pulse signal with the timers A2, A3 and A4). Figure
12.8 shows TAiMR register in event counter mode (when not processing two-phase pulse signal). Figure
12.9 shows TA2MR to TA4MR registers in event counter mode (when processing two-phase pulse signal
with the timers A2, A3 and A4).
Table 12.2 Specifications in Event Counter Mode (when not processing two-phase pulse signal)
Item
Count source
Count operation
Divided ratio
Count start condition
Count stop condition
Interrupt request generation timing Timer overflow or underflow
TAi
pin function
IN
TAi
pin function
OUT
Read from timer
Write to timer
Select function
R
e
. v
2
0 .
0
J
a
. n
3
, 1
2
0
0
7
R
E
J
0
9
B
0
0
4
7
0 -
2
0
0
2 /
, 8
M
1
6
C
2 /
8
) B
• External signals input to TAi
in program)
• Timer B2 overflows or underflows,
timer Aj (j=i-1, except j=4 if i=0) overflows or underflows,
timer Ak (k=i+1, except k=0 if i=4) overflows or underflows
• Increment or decrement can be selected by external signal or program
• When the timer overflows or underflows, it reloads the reload register con-
tents and continues counting. When operating in free-running mode, the
timer continues counting without reloading.
1/ (FFFF
- n + 1) for increment
16
1/ (n + 1) for down-count
Set TAiS bit in the TABSR register to "1" (start counting)
Set TAiS bit to "0" (stop counting)
I/O port or count source input
I/O port, pulse output, or up/down-count select input
Count value can be read by reading TAi register
• 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)
• 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 TAi
pin is inverted . When not counting, the pin outputs a low.
page 104
f o
3
8
5
Specification
pin (i=0 to 4) (effective edge can be selected
IN
n : set value of TAi register
12. Timer
0000
to FFFF
16
16
OUT

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tiny seriesM16c series

Table of Contents