UG-498
ADuCM320 Hardware Reference Manual
Rev. C | Page 128 of 196
Performing SPIx DMA Master Receive
The DMA SPI Rx channel should be configured.
The NVIC should be configured to enable DMA Rx master interrupt (for example, enable DMA Rx master interrupt SPI1 Rx using ISER0[29]).
The DMA transfer stops when the number of bytes have been transferred. Note that the DMA buffer must be of the same size as
SPI1CNT to generate a DMA interrupt when the transfer is complete.
SPI AND POWER-DOWN MODES
In master mode, before entering power-down mode it is recommended to disable the SPI block in SPIxCON[0]. In slave mode, in either
mode of operation, interrupt driven or DMA, the CS line level should be checked via the GPIO registers to ensure that the SPI is not
communicating and that the SPI block is disabled while the CS line is high. At power-up, the SPI block can be reenabled.
REGISTER SUMMARY: SPI0
Table 178. SPI0 Register Summary
Address
Name
Description
Reset
RW
0x4002C000
SPI0STA
Status register
0x0000
R
0x4002C004
SPI0RX
Receive register
0x0000
R
0x4002C008
SPI0TX
Transmit register
0x0000
W
0x4002C00C
SPI0DIV
Baud rate selection register
0x0000
RW
0x4002C010
SPI0CON
SPI configuration register
0x0000
RW
0x4002C014
SPI0DMA
SPI DMA enable register
0x0000
RW
0x4002C018
SPI0CNT
Transfer byte count register
0x0000
RW
REGISTER DETAILS: SPI0
Status Register
Address: 0x4002C000, Reset: 0x0000, Name: SPI0STA
Table 179. Bit Descriptions for SPI0STA
Bits
Bit Name
Description
Reset
Access
15
RESERVED
Reserved.
0x0
R
14
CSRSG
Detected a rising edge on CS, in CONT mode. This bit causes an interrupt.
This can be used to identify the end of an SPI data frame.
0x0
RC
0: cleared to 0 when the status register is read.
1: set to 1 when there was a rising edge in CS line, when the device was in
master mode, continuous transfer, high frequency mode and CSIRQ_EN
was asserted.
13
CSFLG
Detected a falling edge on CS, in CONT mode. This bit causes an interrupt.
This can be used to identify the start of an SPI data frame.
0x0
RC
0: cleared to 0 when the status register is read.
1: set to 1 when there was a falling edge in CS line, when the device was in
master mode, continuous transfer, high frequency mode and CSIRQ_EN
was asserted
12
CSERR
Detected a CS error condition.
0x0
RC
0: cleared to 0 when the status register is read.
1: set to 1 when the CS line was de-asserted abruptly, even before the full
byte of data was transmitted completely. This bit causes an interrupt.
11
RXS
SPI Rx FIFO excess bytes present.
0x0
R
0: this bit is cleared when the number of bytes in the FIFO is equal or less
than the number in SPI0CON[15:14].
1: this bit is set when there are more bytes in the Rx FIFO than indicated in
the MOD bits in SPI0CON.