12 16-BiT PWM TiMeR (T16e)
12-2
Seiko epson Corporation
S1C17624/604/622/602/621 TeChniCal Manual
T16e input/Output Pins
12.2
Table 12.2.1 lists the input/output pins for the T16E module.
2.1 List of T16E Pins
Table 12.
Pin name
i/O
Qty
Function
EXCL3
(Ch.0)
I
1
External clock input pin
Inputs an external clock for the event counter function.
TOUT3
(Ch.0)
O
1
Non-inverted PWM signal output pin
Outputs the PWM signal generated by the timer.
TOUTN3
(Ch.0)
O
1
Inverted PWM signal output pin
Outputs the inverted PWM signal generated by the timer.
The T16E output pins (TOUT
x
, and TOUTN
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 T16E output pins. Also the T16E input pin (EXCL
x
) is shared with an I/O port. Setting the port to input
mode enables it to be used as the T16E input pin with a general-purpose input function. For detailed information on
pin function switching and port control, see the “I/O Ports (P)” chapter.
Operating Modes
12.3
The T16E module has the following two operating modes:
1. Internal clock mode (timer for counting an internal clock)
2. External clock mode (functions as an event counter)
The operating mode is selected using CLKSEL/T16E_CTL
x
register.
Setting CLKSEL to 0 (default) selects internal clock mode, while setting to 1 selects external clock mode.
internal Clock Mode
12.3.1
Internal clock mode uses a divided PCLK clock as the count clock.
The count clock is generated by dividing the PCLK clock into 1/1 to 1/16K. The division ratio can be selected from
the 15 types shown below using T16EDF[3:0]/T16E_DF
x
register.
3.1.1 PCLK Division Ratio Selection
Table 12.
T16eDF[3:0]
Division ratio
T16eDF[3:0]
Division ratio
0xf
Reserved
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)
notes: • The clock generator (CLG) must be configured to supply PCLK to the peripheral modules be-
fore running the timer.
• Make sure the counter is halted before setting the count clock.
For detailed information on the CLG control, see the “Clock Generator (CLG)” chapter.
external Clock Mode
12.3.2
External clock mode uses the clock and pulses input via the EXCL
x
port as the count clock. This enables T16E to
be used as an event counter. Timer operations other than the input clock are the same as for internal clock mode.
To input an external clock to T16E, the I/O port shared with an EXCL
x
input must be set to input mode in advance. For
detailed information on the port control, see the “I/O Ports (P)” chapter.
The T16E counter counts up at the rising edge of the input signal.