UM10850
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2016. All rights reserved.
User manual
Rev. 2.4 — 13 September 2016
300 of 464
NXP Semiconductors
UM10850
Chapter 22: LPC5410x Serial Peripheral Interfaces (SPI0/1)
22.7.5 DMA operation
A DMA request is provided for each SPI direction, and can be used in lieu of interrupts for
transferring data by configuring the DMA controller appropriately. The DMA controller
provides an acknowledgement signal that clears the related request when it completes
handling that request.
The transmitter DMA request is asserted when Tx DMA is enabled and the transmitter can
accept more data.
The receiver DMA request is asserted when Rx DMA is enabled and received data is
available to be read.
22.7.5.1 DMA master mode End-Of-Transfer
When using polled or interrupt mode to transfer data in master mode, the transition to
end-of-transfer status (drive SSEL inactive) is straightforward. The TXDATCTL EOT bit
can be set along with the last data item to be transmitted or the Status register's END
TRANSFER bit can be set after the last data item is written to the TXDAT register.
When using the DMA in master mode, the end-of-transfer status (drive SSEL inactive) can
be generated it 3 ways:
1. The simplest way is using 32 bit wide DMA transfers. This allows the TXCTL bits to be
included with the data. The EOT bit of the last word transferred can be set, to
de-assert the SSEL after the data is transmitted.
2. Another way is through the SPI Tx DMA interrupt handler. This interrupt handler can
set the SPI Status register (STAT) END TRANSFER control bit at the completion of
the DMA transfer.
3. A third way is to use the DMA controller’s linked descriptor capability. The DMA
controller provides for a linked list of DMA transfer control descriptors. The initial
descriptor(s) can be used to transfer most of the data. A final DMA descriptor can be
used to send a single 32 bit wide DMA transfer to TXDATCTL that includes EOT along
with the last of the data.
22.7.6 Data lengths greater than 16 bits
The SPI interface handles data frame sizes from 1 to 16 bits directly. Larger sizes can be
handled by splitting data up into groups of 16 bits or less. For example, 24 bits can be
supported as 2 groups of 16 bits and 8 bits or 2 groups of 12 bits, among others. Frames
of any size, including greater than 32 bits, can supported in the same way.
Details of how to handle larger data widths depend somewhat on other SPI configuration
options. For instance, if it is intended for Slave Selects to be deasserted between frames,
then this must be suppressed when a larger frame is split into more than one part.
Sending 2 groups of 12 bits with SSEL deasserted between 24-bit increments, for
instance, would require changing the value of the EOF bit on alternate 12-bit frames.
22.7.7 Data stalls
A stall for Master transmit data can happen in modes 0 and 2 when SCK cannot be
returned to the rest state until the MSB of the next data frame can be driven on MOSI. In
this case, the stall happens just before the final clock edge of data if the next piece of data
is not yet available.