
221
8.3 Structure of 8/16-bit Timer/Counter
8.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.
s 8/16-bit Timer/Counter Pins
The 8/16-bit timer/counter uses the P20/EC and P22/TO pins. The P20/EC pin can function
either as a general-purpose I/O port (P20), as the external clock input pin of timer (EC). The
P22/TO pin can function either as general-purpose I/O port (P22), as the square wave output
pin of time (TO).
EC:
In the 8-bit timer 1 or 16-bit mode, if external clock input (counter function) is selected (T1CR:
T1CS1 = 11B, T1CS0 = 11B), the counter counts the external clocks applied to this pin. The
P20/EC pin sets the pin as an input port in the port data direction register DDR2: bit 0 = "0"
when using as the EC pin.
TO:
In the 8-bit timer 1 or 16-bit mode, a square wave is output at this pin. Enabling square wave
output (T1CR: T1OS1, T1OS0 = expect 00B) automatically sets the P22/TO pin as an output
pin, regardless of the port data direction register (DDR2: bit 2) value, and sets the pin to function
as the TO pin.
s Block Diagram of 8/16-bit Timer Counter Pins
Figure 8.3-1 Block Diagram of 8/16-Bit Timer/Counter Pins for MB89983
PDR (Port data register)
DDR
In
te
rnal
dat
a
b
u
s
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, watch mode (SPL = 1)
To peripheral input
EC pin only
(Port data direction register)
TO pin only
Stop, watch mode
Pull-up resistor
(Approx. 50 k
/5.0 V)
R
P20/EC
P22/TO
Timer output
output enable
signal