14 16-BIT PWM TIMERS (T16B)
14-14
Seiko Epson Corporation
S1C17M12/M13 TECHNICAL MANUAL
(Rev. 1.2)
(3.4) T16BnCCCTLm.CBUFMD[2:0] bits = 0x3
CNTZEROIF = 1
0xffff
0x0000
RUN = 1
Data (W)
→
MC[15:0]
Data (W)
→
CC[15:0]
Data (W)
→
CC[15:0]
Data (W)
→
CC[15:0]
MODEN = 1
CMPCAPmIF = 1
CMPCAPmIF = 1
CMPCAPmIF = 1
CMPCAPmIF = 1
CNTMAXIF = 1
CNTZEROIF = 1
CNTMAXIF = 1
Counter
Time
Count cycle
Compare buffer
value
MAX value
(T16BnMC register)
Compare period
during counting
down
Compare period
during counting up
PRESET = 1
(3.5) T16BnCCCTLm.CBUFMD[2:0] bits = 0x4
0xffff
0x0000
RUN = 1
Data (W)
→
MC[15:0]
Data (W)
→
CC[15:0]
Data (W)
→
CC[15:0]
Data (W)
→
CC[15:0]
MODEN = 1
CMPCAPmIF = 1
CMPCAPmIF = 1 CMPCAPmIF = 1 CMPCAPmIF = 1
CMPCAPmIF = 1
CNTMAXIF = 1
CNTZEROIF = 1
CNTMAXIF = 1
PRESET = 1
Counter
Time
Count cycle
Compare buffer
value
MAX value
(T16BnMC register)
Compare period
during counting
down
Compare period
during counting up
(Note that the T16BnINTF.CMPCAPmIF/CNTMAXIF/CNTZEROIF bit clearing operations via software are omitted from the figure.)
Figure 14.4.3.2 Compare Buffer Operations
Operations in capture mode
The capture mode captures the counter value when an external event, such as a key entry, occurs (at the speci-
fied edge of the external input/software trigger signal). In this mode, the T16B
n
CCR
m
register functions as the
capture register from which the captured data is read. Furthermore, the TOUT
nm
/CAP
nm
pin is configured to
the CAP
nm
pin.
The trigger signal and the trigger edge to capture the counter value are selected using the T16B
n
CCCTL
m
.
CAPIS[1:0] bits and the T16B
n
CCCTL
m
.CAPTRG[1:0] bits, respectively.
When a specified trigger edge is input during counting, the current counter value is loaded to the T16B
n
CCR
m
register. At the same time the T16B
n
INTF.CMPCAP
m
IF bit is set. The interrupt occurred by this bit can be
used to read the captured data from the T16B
n
CCR
m
register. For example, external event cycles and pulse
widths can be measured from the difference between two captured counter values read.
If the captured data stored in the T16B
n
CCR
m
register is overwritten by the next trigger when the T16B
n
INTF.
CMPCAP
m
IF bit is still set, an overwrite error occurs (the T16B
n
INTF.CAPOW
m
IF bit is set).