SPI Word Lengths
6-32 ADSP-21368 SHARC Processor Hardware Reference
16-Bit Word Lengths
Programs can use 16-bit word lengths when transmitting or receiving.
When transmitting, the SPI port sends out only the lower 16 bits of the
word written to the SPI buffer.
For example, if the processor executes the following instructions:
r0 = 0x12345678
dm(TXSPI) = r0;
the SPI port transmits 0x5678.
When receiving, the SPI port packs the 16-bit word to the lower 32 bits of
the RXSPI buffer while the upper bits in the register are zeros.
For example, if an SPI host sends the processor the 32-bit word
0x12345678, the processor receives the following words:
0x00005678 //first word
0x00001234 //second word
32-Bit Word Lengths
Programs can use 32-bit word lengths when transmitting or receiving. No
packing of the RXSPI or TXSPI registers is necessary as the entire 32-bit reg-
ister is used for the data word.
Packing
In order to communicate with 8-bit SPI devices and store 8-bit words in
internal memory, a packed transfer feature is built into the SPI port. Pack-
ing is enabled through the PACKEN bit in the SPICTL register. The SPI port
unpacks data when it transmits and packs data when it receives. When
packing is enabled, two 8-bit words are packed into one 32-bit word.