Beginning and Ending an SPI Transfer
10-38
ADSP-BF535 Blackfin Processor Hardware Reference
Beginning and Ending an SPI Transfer
The start and finish of an SPI transfer depend on whether the device is
configured as a master or a slave, the
CPHA
mode selected, and the transfer
initiation mode (
TIMOD
) selected. For a master SPI with
CPHA
= 0
, a trans-
fer starts when either
SPIx_TDBR
is written to or
SPIx_RDBR
is read,
depending on
TIMOD
. At the start of the transfer, the enabled slave select
outputs are driven active (low). However, the
SCK
signal remains inactive
for the first half of the first cycle of
SCK
. For a slave with
CPHA
= 0
, the
transfer starts as soon as the
SPISS
input goes low.
For
CPHA
= 1
, a transfer starts with the first active edge of
SCK
for both
slave and master devices. For a master device, a transfer is considered fin-
ished after it sends the last data and simultaneously receives the last data
bit. A transfer for a slave device ends after the last sampling edge of
SCK
.
The
RXS
bit in
SPIx_STATUS
defines when the receive buffer can be read.
The
TXS
bit defines when the transmit buffer can be filled. The end of a
single word transfer occurs when the
RXS
bit is set, indicating that a new
word has just been received and latched into the receive buffer,
SPIx_RDBR
.
RXS
is set shortly after the last sampling edge of
SCK
. The latency is typi-
cally a few
SCLK
cycles and is independent of
CPHA
,
TIMOD
, and the baud
rate. If configured to generate an interrupt when
SPIx_RDBR
is full
(
TIMOD = 00
), the interrupt goes active one
SCLK
cycle after
RXS
is set.
When not relying on this interrupt, the end of a transfer can be detected
by polling the
RXS
bit.
To maintain software compatibility with other SPI devices, the
SPIF
bit is
also available for polling. This bit may have a slightly different behavior
from that of other commercially available devices. For a slave device,
SPIF
is set at the same time as
RXS.
For a master device,
SPIF
is set one-half
SCK
period after the last
SCK
edge, regardless of
CPHA
or
CPOL
.
Thus, the time at which
SPIF
is set depends on the baud rate. In general,
SPIF
is set after
RXS
, but at the lowest baud rate settings (
SPIx_BAUD < 4
).
SPIF
is set before
RXS
is set, and consequently before new data is latched
Содержание ADSP-BF535 Blackfin
Страница 80: ...Development Tools 1 26 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 312: ...Working With Memory 6 86 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 332: ...System Interfaces 7 20 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 360: ...Dynamic Power Management Controller 8 28 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 446: ...Beginning and Ending an SPI Transfer 10 40 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 522: ...Timing Examples 11 76 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 562: ...IrDA Support 12 40 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 608: ...PCI I O Issues 13 46 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 672: ...References 14 64 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 810: ...SDRAM Controller SDC 18 86 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 811: ...ADSP BF535 Blackfin Processor Hardware Reference 18 87 External Bus Interface Unit...
Страница 812: ...SDRAM Controller SDC 18 88 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 860: ...DMA Bus Debug Registers 20 30 ADSP BF535 Blackfin Processor Hardware Reference...
Страница 908: ...SDRAM Controller External Bus Interface Unit B 36 ADSP BF535 Blackfin Processor Hardware Reference...