SAM3X8E Atmel Corporation, SAM3X8E Datasheet - Page 689

no-image

SAM3X8E

Manufacturer Part Number
SAM3X8E
Description
Manufacturer
Atmel Corporation
Datasheets
Figure 32-9. Chip Select Decoding Application Block Diagram: Single Master/Multiple Slave Implementation
32.7.3.8
32.7.3.9
11057A–ATARM–17-Feb-12
11057A–ATARM–17-Feb-12
SPI Master
Peripheral Deselection without DMAC
Peripheral Deselection with DMAC
NPCS0
NPCS1
NPCS2
NPCS3
SPCK
MISO
MOSI
During a transfer of more than one data on a Chip Select without the DMAC, the SPI_TDR is
loaded by the processor, the flag TDRE rises as soon as the content of the SPI_TDR is trans-
ferred into the internal shift register. When this flag is detected high, the SPI_TDR can be
reloaded. If this reload by the processor occurs before the end of the current transfer and if the
next transfer is performed on the same chip select as the current transfer, the Chip Select is not
de-asserted between the two transfers. But depending on the application software handling the
SPI status register flags (by interrupt or polling method) or servicing other interrupts or other
tasks, the processor may not reload the SPI_TDR in time to keep the chip select active (low). A
null Delay Between Consecutive Transfer (DLYBCT) value in the SPI_CSR register, will give
even less time for the processor to reload the SPI_TDR. With some SPI slave peripherals,
requiring the chip select line to remain active (low) during a full set of transfers might lead to
communication errors.
To facilitate interfacing with such devices, the Chip Select Register [CSR0...CSR3] can be pro-
grammed with the CSAAT bit (Chip Select Active After Transfer) at 1. This allows the chip select
lines to remain in their current state (low = active) until transfer to another chip select is required.
Even if the SPI_TDR is not reloaded the chip select will remain active. To have the chip select
line to raise at the end of the transfer the Last transfer Bit (LASTXFER) in the SPI_MR register
must be set at 1 before writing the last data to transmit into the SPI_TDR.
When the Direct Memory Access Controller is used, the chip select line will remain low during
the whole transfer since the TDRE flag is managed by the DMAC itself. The reloading of the
SPI_TDR by the DMAC is done as soon as TDRE flag is set to one. In this case the use of
CSAAT bit might not be needed. However, it may happen that when other DMAC channels con-
1-of-n Decoder/Demultiplexer
SPCK
Slave 0
MISO MOSI
NSS
SPCK MISO MOSI
Slave 1
NSS
SPCK MISO MOSI
SAM3X/A
SAM3X/A
Slave 14
NSS
689
689

Related parts for SAM3X8E