Pwm & Capture Timer Operating Mode - Epson S1C17704 Technical Manual

Cmos 16-bit single chip microcomputer
Table of Contents

Advertisement

13 PWM & CAPTURE TIMER (T16E)
13.2 PWM & Capture Timer Operating Mode
The PWM & capture timer has two operating modes.
1. Internal clock mode (counts the internal clock)
2. External clock mode (functions as an event counter)
Use CLKSEL (D3/T16E_CTL register) to select an operating mode.
∗ CLKSEL: Input Clock Select Bit in the PWM Timer Control (T16E_CTL) Register (D3/0x5306)
When CLKSEL is set to 0 (default), the timer enters internal clock mode; when it is set to 1, the timer enters exter-
nal clock mode.
Internal Clock Mode
In internal clock mode, the timer uses the prescaler output clock as the count clock.
Use the T16EDF[3:0] (D[3:0]/T16E_CLK register) to select the count clock from the 15 clocks, PCLK divided
by 1 to PCLK divided by 16K, generated by the prescaler.
∗ T16EDF[3:0]: Timer Input Clock Select Bits in the PWM Timer Input Clock Select (T16E_CLK) Register
(D[3:0]/0x5308)
T16EDF[3:0]
0xf
0xe
0xd
0xc
0xb
0xa
0x9
0x8
Notes: • Before the PWM & capture timer can start counting in internal clock mode, the prescaler must
be run.
• When setting the count clock, make sure the PWM & capture timer counter is stopped.
For controlling the prescaler, see Chapter 9, "Prescaler (PSC)."
External clock mode
In external clock mode, the timer uses the clock or pulses input from the P27 (EXCL3) port as the count clock.
Thus the timer can be used as an event counter. The timer operation is the same as internal clock mode except
the count clock source.
To input the EXCL3 clock from the P27 port, write 1 to P27MUX (D7/P2_PMUX register) to switch the P27
pin function in advance.
∗ P27MUX: P27 Port Function Select Bit in the P2 Port Function Select (P2_PMUX) Register
The PWM & capture timer counts up at the rising edge of the input signal.
The PWM & capture timer set in this mode does not use the prescaler. If the prescaler clocks are not used in
other peripheral modules, the prescaler can be stopped to reduce current consumption.
13-2
Table 13.2.1 Selecting a Prescaler Clock
Prescaler output clock
Reserved
PCLK•1/16384
PCLK•1/8192
PCLK•1/4096
PCLK•1/2048
PCLK•1/1024
PCLK•1/512
PCLK•1/256
EPSON
T16EDF[3:0]
Prescaler output clock
0x7
PCLK•1/128
0x6
0x5
0x4
0x3
0x2
0x1
0x0
S1C17704 TECHNICAL MANUAL
PCLK•1/64
PCLK•1/32
PCLK•1/16
PCLK•1/8
PCLK•1/4
PCLK•1/2
PCLK•1/1
(Default: 0x0)

Advertisement

Table of Contents
loading

Table of Contents