
11 16-bit Timer (T16)
S1C17003 TECHNICAL MANUAL
EPSON
11-3
11.2.2 External Clock Mode
External clock mode uses the clock and pulses input via the input/output port as a count clock. These inputs can
also be used as an event counter. Timer operations other than the input clock are the same as for internal clock
mode.
External clock input port
The following input ports are used for external clock or pulse input.
Table 11.2.2.1: External clock input port
Timer channel
Input signal name
Input/output port pin
Ch.0
EXCL0
P02
Ch.1
EXCL1
P13
Ch.2
EXCL2
P14
Confirm that the input/output ports used for external clock or pulse input are set to input mode (the default
setting). No pin function selection is needed. While the input/output ports function as general purpose inputs,
the input signal is also sent to the 16-bit timer.
The P02 P13, and P14 ports used by 16-bit timer Ch.0, Ch.1 and Ch.2 incorporate chattering filter circuits and
can also be used as EXCLx inputs. For instructions on controlling chattering filter circuits, see “10.5 P0 and P1
Port Chattering Filter Function.”
Signal polarity selection
CKACTV (D10/T16_CTLx register) is used in this mode to select the falling edge or rising edge of the input
signal for counting.
CKACTV: External Clock Active Level Select Bit in the 16-bit Timer Ch.x Control (T16_CTLx) Register
(D10/0x4226/0x4246/0x4266)
Counting down uses the rising edge when CKACTV is 1 (default) and uses the falling edge when set to 0.
External input clock
PRUN
Counter (CKACTV = 1)
Counter (CKACTV = 0)
n-1 n-2 n-3 n-4 n-5 n-6 n-7 n-8 n-9 n-10
n
n-1 n-2 n-3 n-4 n-5 n-6 n-7 n-8 n-9 n-10
n
Figure 11.2.2.1: External clock mode count
The 16-bit timer does not use the prescaler in this mode. If no other peripheral modules use the prescaler clock,
the prescaler can be stopped to reduce current consumption. (The prescaler clock is used for P0, P1 port chattering
filtering.)
T16