14-10
Seiko Epson Corporation
S1C31D50 TECHNICAL MANUAL
(Rev. 1.00)
Figure 14.5.3.2 Data Reception Flowcharts in Master Mode
Data reception using DMA
For data reception, two DMA controller channels should be used to write dummy data to the
SPIA_
n
TXD register as a reception start trigger and to read the received data from the SPIA_
n
RXD
register.
By setting the SPIA_
n
TBEDMAEN.TBEDMAEN
x
1
bit to 1 (DMA transfer request enabled), a DMA
transfer request is sent to the DMA controller and dummy data is transferred from the specified
memory to the SPIA_
n
TXD register via DMA Ch.
x
1
when the SPIA_
n
INTF.TBEIF bit is set to 1 (transmit
buffer empty).
By setting the SPIA_
n
RBFDMAEN.RBFDMAEN
x
2
bit to 1 (DMA transfer request enabled), a DMA
transfer request is sent to the DMA controller and the received data is transferred from the
SPIA_
n
RXD register to the specified memory via DMA Ch.
x
2
when the SPIA_
n
INTF.RBFIF bit is set to 1
(receive buffer full).
This automates the procedure from Step 2 to Step 8 described above.
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. For more information on
DMA, refer to the
“DMA Controller” chapte
r.
Table 14.5.3.1 DMA Data Structure Configuration Example (for Writing 16-bit Dummy Transmit Data)
Item
Setting example
End pointer
Transfer source
Memory address in which dummy data is stored
Transfer destination
SPIA_
n
TXD register address
Control data
dst_inc
0x3 (no increment)
dst_size
0x1 (haflword)
src_inc
0x3 (no increment)
src_size
0x1 (halfword)
R_power
0x0 (arbitrated for every transfer)
n_minus_1
Number of transfer data
cycle_ctrl
0x1 (basic transfer)
Table 14.5.3.2 DMA Data Structure Configuration Example (for 16-bit Data Reception)
Item
Setting example
No
Yes
No
Yes
No
Yes
No
Yes
Execute this sequence
within theSPICLKn
cycles equivalent to
“
Data bit length - 1
”
from
an interrupt request
Read receive data from
the SPIA_nRXD register
SPIA_
n
INTF.TBEIF = 1 ?
Read the SPIA_nINTF.TBEIF bit
Receive data remained?
Write dummy data (or transmit data) to
the SPIA_nTXD register
Wait for an interrupt request
(SPIA_nINTF.RBFIF = 1)
Data reception
Read the SPIA_
n
INTF.TBEIF bit
Write dummy data (or transmit data) to
the SPIA_
n
TXD register
Receive data remained?
Wait for an interrupt request
(SPIA_
n
INTF.RBFIF = 1)
End
Negate the slave select signal output from
a general-purpose port
Assert the slave select signal output from
a general-purpose port
Data reception
Write dummy data (or transmit data) to
the SPIA_
n
TXD register
SPIA_
n
INTF.TBEIF = 1 ?
Read receive data from
the SPIA_
n
RXD register
Wait for an interrupt request
(SPIA_
n
INTF.TBEIF = 1)
End
Negate the slave select signal output from
a general-purpose port
Assert the slave select signal output from
a general-purpose port
Summary of Contents for S1C31D50
Page 461: ...25 1 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 25 Package TQFP12 48PIN ...
Page 462: ...25 2 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP13 64PIN ...
Page 463: ...25 3 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 TQFP14 80PIN ...
Page 464: ...25 4 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP15 100PIN ...