LSI Logic Confidential
SIO SPI (Serial Peripheral Interface)
15-15
Copyright © 2001, 2002 by LSI Logic Corporation. All rights reserved.
DMA engine do it) returns 32-bits of data, only some of
which are valid. For example, if the last “word” has only one
“real byte”, then data is present in SPI_TEMP[7:0]. If the
last “word” has two bytes, then data is present in
SPI_TEMP[15:0], and so on. This consideration is required
in both DMA and non-DMA modes. If bit granularity is used,
the user may also need to have software mask out bits
within a particular byte to get the valid data.
8.
After the BSIZ+1 bytes are written or read, the cycle terminates. The
ENAB bit is cleared and a SPI_cycle_done interrupt is sent to the
host.
15.2.6 Other Applications
The SPI module is very flexible. Various “ad hoc” modes of operation can
be used beyond the ones described above, such as generic 3-wire
interfaces; for example:
•
Write only N bits to a device by using the SPI_BITGRAN register
•
Sony SPI interface by setting the LSBF bit in the SPI_CONFIG
register.
•
Motorola CPHA=0 mode by using the IBBK, CSBK, and CKBK inter-
byte blanking fields in the SPI_CONFIG register.
•
General Instruments SPI interface by using inter-byte blanking and
setting the GIMD bit in the SPI_CONFIG register.
See the register descriptions for more information.
15.2.7 SPI Programming Guidelines
The SPI module should be programmed in host-polled mode. Host-polled
mode allows full duplex, and the functional characteristics of the
SIO_SPI_CLK and SIO_SPI_CS[n] signals (polarity, SIO_SPI_CS[n]
setup/hold times, inter-byte blanking time, etc.) are programmable.
SIO_SPI_CLK runs only during a SPI transfer cycle. When a cycle is not
occurring, SIO_SPI_CLK is at a static level determined by the CPOL bit.
During a SPI cycle, data is transferred only when SPI_CS[n] is asserted
and SIO_SPI_CLK is active.