
10 16-BIT PWM TIMERS (T16A)
10-6
Seiko Epson Corporation
S1C17705 TECHNICAL MANUAL
Notes: The correct captured data may not be obtained if the captured data is read at the same time
the next value is being captured. Read the capture register twice to check if the read data is
correct as necessary.
To capture counter data properly, both the High and Low period of the CAPx trigger signal
must be longer than the source clock cycle time.
The setting of CAPATRG[1:0] or CAPBTRG[1:0] is ineffective in comparator mode. No counter capturing op-
eration will be performed even if a trigger edge is specified.
The capture mode cannot generate/output the TOUT signal as no compare signal is generated.
Repeat Mode and One-Shot Mode
10.4.2
Each counter features two count modes: repeat mode and one-shot mode. The count mode is selected using TRMD
/T16A_CTLx register.
Repeat mode (TRMD = 0, default)
Setting TRMD to 0 sets the corresponding counter to repeat mode.
In this mode, once the count starts, the counter continues running until stopped by the application program. The
counter continues the count even if the counter is reset to 0 or returns to 0 due to a counter overflow. The coun-
ter should be set to this mode to generate periodic interrupts at desired intervals or to generate a timer output
waveform.
One-shot mode (TRMD = 1)
Setting TRMD to 1 sets the corresponding counter to one-shot mode.
In this mode, the counter stops automatically as soon as the counter is reset or it overflows. The counter should
be set to this mode to set a specific wait time or for pulse width measurement.
Normal Channel Mode and Multi-Comparator/Capture Mode
10.4.3
One channel of the T16A module basically consists of a counter block and a comparator/capture block. The T16A
module also allows the application to use expanded comparator/capture function by connecting two or more com-
parator/capture blocks to one counter block. To support this expansion, two operating modes are provided: normal
channel mode and multi-comparator/capture mode. This operating mode can be selected using MULTIMD/T16_
CLK0 register.
Normal channel mode (MULTIMD = 0, default)
Set the T16A module to this mode when using it as four channels of different timers by connecting a counter
block with the comparator/capture block of the same channel. In this mode, the counters can use different count
clocks.
Each timer channel provides CCABCNT[1:0]/T16A_CTLx register to select a counter channel to be connected
to the comparator/capture block.
4.3.1 Counter Selection
Table 10.
CCABCNT[1:0]
Counter channel
0x3
Ch.3 (Counter 3)
0x2
Ch.2 (Counter 2)
0x1
Ch.1 (Counter 1)
0x0
Ch.0 (Counter 0)
(Default: 0x0)
When using the T16A module in normal channel mode, be sure to connect the counter block to the comparator/
capture block in the same channel.