15 16-BIT PWM TIMER (T16A5)
15-2
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
Comparison data can be read or written directly from/to the compare A and compare B registers. The compare
buffers are separately provided to load data to the compare A and compare B registers automatically by the
compare B signal. Software can select which of the compare register and buffer the comparison values are writ-
ten to.
When the capture function is enabled, the compare A and compare B registers are used as the capture A and
capture B registers, respectively. The capture A and capture B circuits can input a trigger signal individually,
and the counter value is loaded to the respective capture register at the selected edge of the trigger signal.
The capturing operation can generate an interrupt, this make it possible to read the captured data in the interrupt
handler routine. Also an overwrite interrupt can be generated for the error handling when the counter value is
captured before reading the previous captured data.
Note: Both channels of the T16A5 module has the same functions except for the control register ad-
dresses. The description in this section applies to both channels of the T16A5 module unless oth-
erwise specified. Letter ‘
x
’ in the register name refers to the channel number (0 or 1).
Example: T16A_CTL
x
register
Ch.0: T16A_CTL0 register
Ch.1: T16A_CTL1 register
T16A5 Input/Output Pins
15.2
Table 15.2.1 lists the input/output pins for the T16A5 module.
2.1 List of T16A5 Pins
Table 15.
Pin name
I/O
Qty
Function
T16A_EXCL_0 (Ch.0)
T16A_EXCL_1 (Ch.1)
I
2
T16A5 external clock input pin
Inputs an external clock for the event counter function.
The T16A_EXCL_0 pin can also be used as the WDT external clock input pin.
T16A_ATMA_0 (Ch.0)
T16A_ATMA_1 (Ch.1)
I/O
2
T16A5 system A input/output pin
Outputs timer generating signal in comparator mode.
Inputs a counter-capture trigger signal in capture mode.
T16A_ATMB_0 (Ch.0)
T16A_ATMB_1 (Ch.1)
I/O
2
T16A5 system B input/output pin
Outputs timer generating signal in comparator mode.
Inputs a counter-capture trigger signal in capture mode.
The T16A5 input/output pins (T16A_EXCL_
x
, T16A_ATMA_
x
, T16A_ATMB_
x
) 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 T16A5 input/output pins.
For detailed information on pin function switching, see the “I/O Ports (GPIO)” chapter.
Count Clock
15.3
The count clock is selected by CLKS[3:0]/T16A_CTL
x
register from the 15 types generated by the prescaler (PSC
Ch.0) dividing the PCLK1 clock into 1/1 to 1/16K and an external clock.
3.1 Count Clock (PCLK1 Division Ratio) Selection
Table 15.
CLKS[3:0]
Division ratio
CLKS[3:0]
Division ratio
0xf
External clock
0x7
1/128
0xe
1/16384
0x6
1/64
0xd
1/8192
0x5
1/32
0xc
1/4096
0x4
1/16
0xb
1/2048
0x3
1/8
0xa
1/1024
0x2
1/4
0x9
1/512
0x1
1/2
0x8
1/256
0x0
1/1
(Default: 0x0)