Epson Arm S1C31 Series Technical Manual page 253

Cmos 32-bit single chip microcontroller
Table of Contents

Advertisement

Compare period and count cycle settings using DMA
By setting the T16B_nCCmDMAEN.CCmDMAENx bit to 1 (DMA transfer request enabled) in comparator
mode, a DMA transfer request is sent to the DMA controller and compare data is transferred from the speci-
fied memory to the T16B_nCCRm register via DMA Ch.x when the T16B_nINTF.CMPCAPmIF bit is set
to 1 (when the counter reaches the compare buffer value).
Similarly, by setting the T16B_nCCmDMAEN.MZDMAENx bit to 1 (DMA transfer request enabled), a
DMA transfer request is sent to the DMA controller and a counter MAX value is transferred from the speci-
fied memory to the T16B_nMC register via DMA Ch.x when the T16B_nINTF.CNTMAXIF bit is set to
1 (when the counter reaches the MAX value) in up or up/down count mode, or when the T16B_nINTF.
CNTZEROIF bit is set to 1 (when the counter reaches zero) in down count mode.
This automates the compare period and count cycle settings of the timer counter.
The transfer source/destination and control data must be set for the DMA controller and the relevant DMA
channel must be enabled to start a DMA transfer in advance so that the setting data will be transferred to the
T16B_nCCRm or T16B_nMC register. For more information on DMA, refer to the "DMA Controller" chap-
ter.
Table 17.4.3.1 DMA Data Structure Configuration Example (T16B Compare Period and Count Cycle Settings)
End pointer
Control data dst_inc
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_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_nC-
CRm 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).
S1C31D41 TECHNICAL MANUAL
(Rev. 1.1)
Item
Transfer source
Memory address in which the last setting data is stored
Transfer destination T16B_nCCRm or T16B_nMC register address
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)
Seiko Epson Corporation
17 16-BIT PWM TIMERS (T16B)
Setting example
17-15

Advertisement

Table of Contents
loading

This manual is also suitable for:

Arm s1c31d41

Table of Contents