time. Red arrows indicate routing delay between master and slave devices. Blue arrow indicates sampling
delay within slave from receiving
sclk_in
to driving
txd
out. †
Figure 19-4: Effects of Round Trip Routing Delays on sclk_out Signal
MSB
LSB
LSB
LSB
MSB
spi_m_clk
sclk_out
txd_mst
rxd_mst
sclk_in
rxd_slv
txd_slv
baud-rate = 4
dly=0
Red arrows indicate routing dela
y between master and slave devices
Blue arrow indicates sampling delay within slav
e from receiving slk_in to driving txd out
dly=4
MSB
LSB
MSB
Data Transfers
The SPI master starts data transfers when all the following conditions are met:
• The SPI master is enabled
• There is at least one valid entry in the transmit FIFO buffer
• A slave device is selected
When actively transferring data, the busy flag (
BUSY
) in the status register (
SR
) is set. You must wait until
the busy flag is cleared before attempting a new serial transfer. †
The
BUSY
status is not set when the data are written into the transmit FIFO buffer. This bit gets set
only when the target slave has been selected and the transfer is underway. After writing data into the
Note:
transmit FIFO buffer, the shift logic does not begin the serial transfer until a positive edge of the
sclk_out
signal is present. The delay in waiting for this positive edge depends on the baud rate of
the serial transfer. Before polling the
BUSY
status, you should first poll the Transit FIFO Empty
(
TFE
) status (waiting for 1) or wait for (
BAUDR
* SPI clock) clock cycles. †
Master SPI and SSP Serial Transfers
“Motorola SPI Protocol” and “Texas Instruments Synchronous Serial Protocol (SSP)” describe the SPI and
SSP serial protocols, respectively. †
When the transfer mode is “transmit and receive” or “transmit only” (TMOD = 0 or TMOD = 1, respectively),
transfers are terminated by the shift control logic when the transmit FIFO buffer is empty. For continuous
data transfers, you must ensure that the transmit FIFO buffer does not become empty before all the data
SPI Controller
Altera Corporation
cv_54019
Data Transfers
19-8
2013.12.30