11 16-BiT PWM TiMeR (T16a2)
S1C17153 TeChniCal Manual
Seiko epson Corporation
11-13
(Rev. 1.0)
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.
• In half clock mode, the T16A_CCB
x
register setting value must be less than [T16A_CCA
x
setting value / 2 + 0x8000].
D[5:4]
Reserved
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.
Setting CBUFEN to 0 disables the compare buffer. The compare A and B signals will be generated by
comparing the counter values with the compare A and B register values.
note
: Make sure the counter is halted (PRUN = 0) before setting CBUFEN.
D2
TRMD: Count Mode Select Bit
Selects the count mode.
1 (R/W): One-shot mode
0 (R/W): Repeat mode (default)
Setting TRMD to 0 sets the counter to repeat mode. In this mode, once the count starts, the counter con-
tinues counting until stopped by the application program.
Setting TRMD to 1 sets the counter to one-shot mode. In this mode, the counter stops counting auto-
matically as soon as the compare B signal is generated.
D1
PReSeT: Counter Reset Bit
Resets the counter.
1 (W):
Reset
0 (W):
Ignored
0 (R):
Normally 0 when read out (default)
Writing 1 to this bit resets the counter to 0.
D0
PRun: Counter Run/Stop Control Bit
Starts/stops the count.
1 (W):
Run
0 (W):
Stop
1 (R):
Counting
0 (R):
Stopped (default)
The counter starts counting when PRUN is written as 1 and stops when written as 0. The counter data is
retained even if the counter is stopped.