12 16-BIT PWM TIMER (T16A2)
12-2
Seiko Epson Corporation
S1C17651 TECHNICAL MANUAL
Comparator/capture block
The comparator/capture block provides a counter comparison function (comparator mode) and a count capture
function (capture mode). When comparator mode is selected via software, the comparator/capture block can be
used as a PWM waveform or clock generator. When capture mode is selected, this block can be used as a count
capture unit for measuring external event periods/cycles. The comparator circuit generates the compare A and
B signals that represent matching between compare A/B register values (set via software) and the counter value,
and outputs the signals to the TOUT control circuit and the interrupt control circuit. The TOUT control circuit
generates a PWM or other signal from the compare A and B signals and outputs it to the external TOUTAx and
TOUTBx pins. The capture circuit loads the counter value to the capture A or B register using the CAPAx or
CAPBx input signal that represents external events issued as a trigger. The interrupt control circuit outputs an
interrupt signal to the interrupt controller (ITC) module according to the interrupt condition that has been set.
Comparator mode and capture mode cannot be used simultaneously in the same channel.
Note: The letter ‘x’ in register and pin names refers to a channel number (0).
Example: T16A_CTLx register, TOUTAx pin
Ch.0: T16A_CTL0 register, TOUTA0
T16A2 Input/Output Pins
12.2
Table 12.2.1 lists the input/output pins for the T16A2 module.
2.1 List of T16A2 Pins
Table 12.
Pin name
I/O
Qty
Function
EXCL0
(for Ch.0)
I
1
External clock input pins
Inputs an external clock for the event counter function.
CAPA0, CAPB0
(for Ch.0)
I
2
Counter-capture trigger signal input pins (effective in capture mode)
The specified edge (falling edge, rising edge, or both) of the signal
input to the CAPAx pin captures the counter data into the capture A
register. The CAPBx pin input signal captures the counter data into the
capture B register.
TOUTA0, TOUTB0 (for Ch.0)
O
2
Timer generating signal output pins (effective in comparator mode)
T16A2 has two output pins and the signals generated in different condi-
tions can be output.
The T16A2 input/output pins (EXCLx, CAPAx, CAPBx, TOUTAx, and TOUTBx) are shared with I/O ports and are
initially set as general purpose I/O port pins. The pin functions must be switched using the port function select bits
to use the general purpose I/O port pins as T16A2 input/output pins.
For detailed information on pin function switching, see the “I/O Ports (P)” chapter.
Count Clock
12.3
The clock controller includes a clock source selector, dividers, and a gate circuit for controlling the count clock.
OSC1 clock
External clock (EXCLx)
OSC3A clock
Counter Ch.x
Divider
(1/1–1/16K)
Divider
(1/1–1/256)
Clock controller Ch.x
OSC3B clock
Divider
(1/1–1/16K)
T16ACLKSRC[1:0]
T16ACLKD[3:0]
T16ACLKE
3.1 Clock Controller
Figure 12.