All blocks
Connectivity
SPI
Fast four-wire bus for screens, card readers and flash
runs on the boardLoading the 3D view…
- SCK
- MOSI
- MISO
- CS
Key facts
Four SPI controllers: SPI0 and SPI1 talk to the flash and PSRAM; GP-SPI2 and GP-SPI3 are yours.
As a master up to 80 MHz, as a slave up to 60 MHz, in all four clock modes (0-3).
GP-SPI2 has six chip selects and goes up to 8 data lines; GP-SPI3 has three chip selects and up to 4 lines.
The CPU can move up to 64 bytes per transfer; with DMA a single transfer takes up to 32 KB, segmented ones have no limit.
GP-SPI2 (FSPI) can reach its pins through the IO MUX or the GPIO matrix; GP-SPI3 always goes through the matrix.
In our labs
29 labs use this block, across 5 tracks. Open a track to see them.
Display & input2 labs
- done by you
- runs on the board
- built, not flashed
- planned
Key registers
SPI_CMD_REGoffset 0x0000| Bits | Field | What it does |
|---|---|---|
| 24 | SPI_USR | Start a transfer; clears itself when done. |
| 23 | SPI_UPDATE | Copy the new settings into the SPI clock domain. |
SPI_CLOCK_REGoffset 0x000C| Bits | Field | What it does |
|---|---|---|
| 31 | SPI_CLK_EQU_SYSCLK | 1: SPI clock = APB clock (80 MHz). |
| 21:18 | SPI_CLKDIV_PRE | Pre-divider. |
| 17:12 | SPI_CLKCNT_N | Divider: f = APB / (PRE+1) / (N+1). |
SPI_MS_DLEN_REGoffset 0x001C| Bits | Field | What it does |
|---|---|---|
| 17:0 | SPI_MS_DATA_BITLEN | Data length of the transfer, in bits, minus 1. |
SPI_MISC_REGoffset 0x0020| Bits | Field | What it does |
|---|---|---|
| 29 | SPI_CK_IDLE_EDGE | Clock level when idle (the polarity, CPOL). |
| 0 | SPI_CS0_DIS | 1 disables the CS0 pin. |
SPI_W0_REGoffset 0x0098| Bits | Field | What it does |
|---|---|---|
| 31:0 | SPI_BUF0 | First of 16 data buffers (SPI_W0 to W15, 64 bytes) for CPU-driven transfers. |
Read the full sectionTechnical reference §30