SWRA779 September 2023 CC3300 , CC3301
There are four modes of operation defined in the SPI standard. For communication to be successful, the controller and peripheral devices must be configured in the same way. The four modes are all combinations of SPI clock polarity and phase. Only mode 0 is supported, meaning the SPI clock is active high where data is sampled on rising edge of the clock and shifted out on falling edge of the clock.
There are few more SPI parameters that may be configured during interface initialization from the host for better compatibility and flexibility.
Table 3-5 illustrates the different option for data on the wire.
Format | Data on Wire | |||
---|---|---|---|---|
16-Bit Little Endian no swizzle | B1(b15 to b8) | B0(b7 to b0) | B3(b31 to b24) | B2(b23 to b16) |
16-Bit Little Endian with swizzle | B0(b0 to b7) | B1(b8 to b15) | B2(b16 to b23) | B3(b24 to b31) |
16-Bit Big Endian no swizzle | B0(b7 to b0) | B1(b15 to b8) | B2(b23 to b16) | B3(b31 to b24) |
16-Bit Big Endian with swizzle | B1(b8 to b15) | B0(b0 to b7) | B3(b24 to b31) | B2(b16 to b23) |
32-Bit Little Endian no swizzle | B3(b31 to b24) | B2(b23 to b16) | B1(b15 to b8) | B0(b7 to b0) |
32-bit Little Endian with swizzle | B0(b0 to b7) | B1(b8 to b15) | B2(b16 to b23) | B3(b24 to b31) |
32-Bit Big Endian no swizzle | B0(b7 to b0) | B1(b15 to b8) | B2(b23 to b16) | B3(b31 to b24) |
32-Bit Big Endian with swizzle | B3(b24 to b3) | B2(b16 to b23) | B1(b8 to b15) | B0(b0 to b7) |
Configuring these characteristics is done during initialization of the host interface. Since the hardware lines of the host interface are SDIO lines by default, and since the same lines are used for SPI as well, the initial configuration of the SPI characteristics is applied using an SDIO command, CMD0 (see SPI chapter).
Table 3-6 summarizes all possible configurations.
Characteristics | Supported Configuration |
---|---|
Clock polarity | Data is sampled on the rising edge. Data is shifted out on falling edge for standard SPI and rising edge for non-standard SPI |
Clock phase | Clock idles at logical 0 |
Word size | 16 or 32 bits |
Host Endianity | Configurable |
Bit order | Configurable via the bit swizzle |
Chip Select polarity | Active low |
Host Interrupt polarity | Configurable |
Clock frequency | Up to 26 MHz for standard mode and 52 MHz for non-standard mode |
Chip select assertion between words | May go high between words |
Autonomous mode | Supported |