
229
CHAPTER 10 8/16-BIT TIMER/COUNTER
10.3
Structure of 8/16-bit Timer/Counter
This section describes the pins, pin block diagram, registers, and interrupt source of
the 8/16-bit Timer/Counter.
I 8/16-bit timer/counter pins
The 8/16-bit timer/counter 11, 12 uses the P14/EC1 pin and P15/TO1 pin. The 8/16-bit timer/counter 21, 22
uses the P16/EC2 and P17/TO2 pin. The P14/EC1, P16/EC2 pin can function as a general-purpose I/O port
(P14, P16) or external clock input pin of timer(EC1, EC2). The P15/TO1, P17/TO2 pin can function as a
general-purpose I/O port (P15, P17) or the square wave output pin of timer(TO1, TO2).
EC1 and EC2:
In the 8-bit timer 11/21 or 16-bit mode, if external clock input (counter function) is selected (T1/3CR:
T1CS1 = 1, T1CS0 = 1), the counter counts the external clocks applied to this pin. The P14/EC1, P16/
EC2 pin sets the pin as an input port in the port data direction register DDR1: bit 4, bit 6 = "0") when
using as the EC1 and EC2 pin.
TO1 and TO2:
In the 8-bit timer 11/21 or 16-bit mode, a square wave is output at this pin. Enabling square wave output
(T1/3CR: T1OS1, T1OS0 = 11B) automatically sets the P15/TO1, P17/TO2 pin as an output pin,
regardless of the port data direction register (DDR1: bit 5, bit 7) value, and sets the pin to function as
the TO1, TO2 pin.
I Block diagram of 8/16-bit timer counter pins
Figure 10.3-1 Block diagram of 8/16-bit timer/counter pins
PDR (Port data register)
DDR
In
te
rn
al
dat
a
bus
PDR read
PDR read (for bit manipulation instructions)
Output latch
PDR write
DDR write
Pin
SPL: Pin state specification bit in the standby control register (STBC)
N-ch
Stop mode (SPL = 1)
To peripheral input
(Port data direction register)
P15/TO1, P17/TO2
Peripheral
output enable
Stop mode
P-ch
P14/EC1
pull-up resistor
Pull-up resistor
Approx. 50 k
P-ch
P14/EC1, P15/TO1
P16/EC2, P17/TO2
P16/EC2
control register