![](http://datasheet.mmic.net.cn/140000/S1C17601F00E100_datasheet_5011483/S1C17601F00E100_169.png)
13 PWM Timer (T16E)
13-2
Seiko Epson Corporation
S1C17601 TECHNICAL MANUAL
13.2 PWM Timer Operating Modes
The PWM Timer has the following two operating modes:
1. Internal clock mode (Timer counting internal clock)
2. External clock mode (Functions as event counter)
The operating mode is selected using CLKSEL (D3/T16E_CTLx register).
CLKSEL: Input Clock Select Bit in the PWM Timer Ch.x Control (T16E_CTLx) Register (D3/0x5306/0x5366)
Setting CLKSEL to 0 (default) selects internal clock mode, while setting to 1 selects external clock mode.
Internal clock mode
Internal clock mode uses the prescaler output clock as the count clock.
The count clock is selected by the T16EDF[3:0] (D[3:0]/T16E_CLKx register) from the 15 types generated by
the prescaler dividing the PCLK clock into 1/1 to 1/16 K divisions.
T16EDF[3:0]: Timer Input Clock Select Bits in the PWM Timer Ch.x Input Clock Select (T16E_CLKx)
Register (D[3:0]/0x5308/0x5368)
Table 13.2.1: Prescaler clock selection
T16EDF[3:0]
Prescaler output clock
T16EDF[3:0]
Prescaler output clock
0xf
Reserved
0x7
PCLK1/128
0xe
PCLK1/16384
0x6
PCLK1/64
0xd
PCLK1/8192
0x5
PCLK1/32
0xc
PCLK1/4096
0x4
PCLK1/16
0xb
PCLK1/2048
0x3
PCLK1/8
0xa
PCLK1/1024
0x2
PCLK1/4
0x9
PCLK1/512
0x1
PCLK1/2
0x8
PCLK1/256
0x0
PCLK1/1
(Default: 0x0)
Note: The prescaler must run before operating the PWM Timer in internal clock mode.
Make sure the PWM Timer count is halted before changing count clock settings.
For detailed information on the prescaler control, see “9 Prescaler (PSC).”
External clock mode
In external clock mode, channel 0 uses a clock or pulse input via the P06 (EXCL3) port and channel 1 uses
a clock or pulse input via the P07 (EXCL4) as the count clock. Therefore it can be used as an event counter.
Timer operations other than input clock are the same as those in the internal clock mode.
To input the EXCL3 or EXCL4 clock via the P06 or P07 port, write 0 to the P06MUX (D5-4/P0_PMUX
register) or P07MUX (D7-6/P0_PMUX register) to change the pin function, and set it to the input mode.
P06MUX: P06 Port Function Select Bit in the P0 Port Function Select (P0_PMUX) Register (D5-4/0x52a1)
P07MUX: P07 Port Function Select Bit in the P0 Port Function Select (P0_PMUX) Register (D7-6/0x52a1)
The PWM Timer increments counts based on the input signal rising edge.
The PWM Timer does not use the prescaler in this mode. If no other peripheral modules are using the prescaler
clock, the prescaler can be stopped to reduce current consumption.
For the input rules of external clock, see “28.11 External Clock Input Characteristics”.