ADSP-BF50x Blackfin Processor Hardware Reference
18-23
SPI-Compatible Port Controller
finished 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 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,
SPI_RDBR
. For a master
SPI,
RXS
is set shortly after the last sampling edge of
SCK
. For a slave SPI,
RXS
is set shortly after the last
SCK
edge, regardless of
CPHA
or
CPOL
. The
latency is typically a few
SCLK
cycles and is independent of
TIMOD
and the
baud rate. If configured to generate an interrupt when
SPI_RDBR
is full
(
TIMOD
=
b#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 cleared shortly after the start of a transfer (
SPISS
going low for
CPHA
= 0,
first active edge of
SCK
on
CPHA
= 1), and is set at the same time as
RXS
. For
a master device,
SPIF
is cleared shortly after the start of a transfer (either
by writing the
SPI_TDBR
or reading the
SPI_RDBR
, depending on
TIMOD
),
and is set one-half
SCK
period after the last
SCK
edge, regardless of
CPHA
or
CPOL
.
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 (
SPI_BAUD
< 4). The
SPIF
bit is set before
RXS
is set, and consequently before new data is latched into
SPI_RDBR
, because of the latency. Therefore, for
SPI_BAUD
= 2 or
SPI_BAUD
= 3,
RXS
must be set before
SPIF
to read
SPI_RDBR
. For larger
SPI_BAUD
settings,
RXS
is guaranteed to be set before
SPIF
is set.
If the SPI port is used to transmit and receive at the same time, or to
switch between receive and transmit operation frequently, then the
TIMOD
=
b#00
mode may be the best operation option. In this mode,
Summary of Contents for EZ-KIT Lite ADSP-BF506F
Page 50: ...Contents l ADSP BF50x Blackfin Processor Hardware Reference ...
Page 92: ...Development Tools 1 30 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 110: ...Interface Overview 3 12 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 236: ...Internal Flash Memory Control Registers 6 92 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 650: ...Programming Examples 15 56 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 804: ...Programming Examples 17 92 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 1194: ...Programming Examples 24 90 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 1256: ...ACM Registers A 50 ADSP BF50x Blackfin Processor Hardware Reference ...
Page 1264: ...Boundary Scan Architecture B 8 ADSP BF50x Blackfin Processor Hardware Reference ...