Download Print this page

Epson S1C31D50 Technical Instructions page 281

Cmos 32-bit single chip microcontroller
Hide thumbs Also See for S1C31D50:

Advertisement

Table 17.4.3.1 DMA Data Structure Configuration Example (T16B Compare Period and Count Cycle Settings)
End pointer
Control data
Operations in capture mode
The capture mode captures the counter value when an external event, such as a key entry, occurs (at
the specified edge of the external input/software trigger signal). In this mode, the T16B_nCCRm
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
T16B_nCCCTLm. CAPIS[1:0] bits and the T16B_nCCCTLm.CAPTRG[1:0] bits, respectively.
When a specified trigger edge is input during counting, the current counter value is loaded to the
T16B_nCCRm register. At the same time the T16B_nINTF.CMPCAPmIF bit is set. The interrupt occurred
by this bit can be used to read the captured data from the T16B_nCCRm 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_nCCRm register is overwritten by the next trigger when
the T16B_
nINTF.CMPCAPmIF bit is still set, an overwrite error occurs (the T16B_nINTF.CAPOWmIF bit is set).
PRESET = 1
RUN = 1
MODEN = 1
0xffff
Counter
0x0000
Figure 17.4.3.3 Operations in Capture Mode (Example in One-shot Up Count Mode)
17-16
Item
Transfer source
Memory address in which the last setting data is
stored
Transfer
T16B_nCCRm or T16B_nMC register address
destination
dst_inc
0x3 (no increment)
dst_size
0x1 (haflword)
src_inc
0x1 (+2)
src_size
0x1 (halfword)
R_power
0x0 (arbitrated for every transfer)
n_minus_1
Number of transfer data
cycle_ctrl
0x1 (basic transfer)
T16B_nCCCTLm.CAPTRG[1:0] bits = 0x3 (Trigger: falling and rising edges)
CC[15:0] → Data (R)
CC[15:0] → Data (R)
CMPCAPmIF = 1
CMPCAPmIF = 0
CMPCAPmIF = 1
CMPCAPmIF = 1
Counter value CC[15:0]
Counter value CC[15:0]
Seiko Epson Corporation
Setting example
Software operation
Hardware operation
Captured value
(T16B_nCCRm register)
Time
CAPOWmIF = 1
Counter value CC[15:0]
S1C31D50 TECHNICAL MANUAL
(Rev. 1.00)

Advertisement

loading