Epson S1C17W03 Technical Manual page 183

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

15 16-BIT PWM TIMERS (T16B)
(3.4) T16BnCCCTLm.CBUFMD[2:0] bits = 0x3
Data (W) → CC[15:0]
Data (W) → MC[15:0]
MODEN = 1
PRESET = 1
RUN = 1
0xffff
Compare period
during counting up
Counter
0x0000
(3.5) T16BnCCCTLm.CBUFMD[2:0] bits = 0x4
Data (W) → CC[15:0]
Data (W) → MC[15:0]
MODEN = 1
PRESET = 1
RUN = 1
0xffff
Compare period
during counting up
Counter
0x0000
(Note that the T16BnINTF.CMPCAPmIF/CNTMAXIF/CNTZEROIF bit clearing operations via software are omitted from the figure.)
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 T16BnCCRm register functions as the
capture register from which the captured data is read. Furthermore, the TOUTnm/CAPnm pin is configured to
the CAPnm pin.
The trigger signal and the trigger edge to capture the counter value are selected using the T16BnCCCTLm.
CAPIS[1:0] bits and the T16BnCCCTLm.CAPTRG[1:0] bits, respectively.
When a specified trigger edge is input during counting, the current counter value is loaded to the T16BnCCRm
register. At the same time the T16BnINTF.CMPCAPmIF bit is set. The interrupt occurred by this bit can be
used to read the captured data from the T16BnCCRm 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 T16BnCCRm register is overwritten by the next trigger when the T16BnINTF.
CMPCAPmIF bit is still set, an overwrite error occurs (the T16BnINTF.CAPOWmIF bit is set).
15-14
Data (W) → CC[15:0]
Count cycle
Compare period
during counting
down
CNTMAXIF = 1
CNTZEROIF = 1
CMPCAPmIF = 1
CMPCAPmIF = 1
Data (W) → CC[15:0]
Count cycle
Compare period
during counting
down
CNTMAXIF = 1
CNTZEROIF = 1
CMPCAPmIF = 1
CMPCAPmIF = 1
Figure 15.4.3.2 Compare Buffer Operations
Seiko Epson Corporation
Data (W) → CC[15:0]
CNTMAXIF = 1
CMPCAPmIF = 1
Data (W) → CC[15:0]
CMPCAPmIF = 1 CMPCAPmIF = 1 CMPCAPmIF = 1
S1C17W03/W04 TECHNICAL MANUAL
MAX value
(T16BnMC register)
Compare buffer
value
Time
CNTZEROIF = 1
CMPCAPmIF = 1
MAX value
(T16BnMC register)
Compare buffer
value
Time
CNTMAXIF = 1
(Rev. 1.2)

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17w04

Table of Contents