
13 16-BiT PWM TiMeRS (T16a2)
13-14
Seiko epson Corporation
S1C17624/604/622/602/621 TeChniCal Manual
T16a Counter Ch.
x
Control Registers (T16a_CTl
x
)
Register name address
Bit
name
Function
Setting
init. R/W
Remarks
T16a Counter
Ch.
x
Control
Register
(T16a_CTl
x
)
0x5400
0x5420
(16 bits)
D15–7 –
reserved
–
–
–
0 when being read.
D6
hCM
Half clock mode enable
1 Enable
0 Disable
0
R/W
D5–4 CCaBCnT
[1:0]
Counter select
CCABCNT[1:0] Counter Ch.
0x0 R/W
0x3, 0x2
0x1
0x0
reserved
Ch.1
Ch.0
D3
CBuFen
Compare buffer enable
1 Enable
0 Disable
0
R/W
D2
TRMD
Count mode select
1 One-shot
0 Repeat
0
R/W
D1
PReSeT
Counter reset
1 Reset
0 Ignored
0
W 0 when being read.
D0
PRun
Counter run/stop control
1 Run
0 Stop
0
R/W
D[15:7] Reserved
D6
hCM: half Clock Mode enable Bit
Sets T16A2 to half clock mode.
1 (R/W): Enabled (half clock mode)
0 (R/W): Disabled (normal clock mode) (default)
Setting HCM to 1 places T16A2 into half clock mode. In half clock mode, T16A2 uses the dual-edge
counter, which counts at the rising and falling edges of the count clock, to generate a compare A signal
when the dual-edge counter value matches the T16A_CCA
x
register. This makes it possible to control
the duty ratio with double accuracy as compared to normal clock mode.
Setting HCM to 0 places T16A2 into normal clock mode. In normal clock mode, T16A2 generates a
compare A signal when the T16A_TC
x
register value matches the T16A_CCA
x
register.
notes: • T16A2 must be placed into comparator mode to set half clock mode, as it is effective only
when PWM waveform is generated.
Be sure to set T16A2 to normal clock mode under a condition shown below.
(1) When T16A2 is placed into capture mode
(2) When TOUTAMD/T16A_CCCTL
x
register is set to 0x2 or 0x3
(3) When TOUTBMD/T16A_CCCTL
x
register is set to 0x2 or 0x3
• The dual-edge counter value cannot be read.
• Do not use the compare A interrupt in half clock mode.
D[5:4]
CCaBCnT[1:0]: Counter Select Bits
Selects a counter to be connected to the comparator/capture block of each channel in multi-comparator/
capture mode (MULTIMD/T16A_CLK0 register = 1).
8.4 Counter Selection
Table 13.
CCaBCnT[1:0]
Counter channel
0x3, 0x2
Reserved
0x1
Ch.1 (Counter 1)
0x0
Ch.0 (Counter 0)
(Default: 0x0)
When using the T16A2 module in normal channel mode (T16A2MULTIMD = 0), be sure to connect
the counter of the same channel to each comparator/capture block.
D3
CBuFen: Compare Buffer enable Bit
Enables or disables writing to the compare buffer.
1 (R/W): Enabled
0 (R/W): Disabled (default)
Setting CBUFEN to 1 enables the compare buffer. The compare A and B signals will be generated by
comparing the counter values with the compare A and B buffer values instead of the compare A and B
register values. The compare A and B register values written via software are loaded to the compare A
and B buffers when the compare B signal is generated.