A drop-in SPI master for talking to flash, sensors, and off-chip devices
The Zen SPI master controller is a Motorola 4-wire SPI master a client instantiates in their SoC to drive serial flash, EEPROM, ADC/DAC converters, sensors, and display or radio modules. It supports all four SPI modes, programmable frame width and clock rate, buffered TX/RX FIFOs, and multi-device chip-select — and attaches to the common peripheral bus with APB4 or AXI4-Lite frontends for drop-in integration. Product / integrator view; every number is sourced from the product datasheet or marked TBC with an owner.
1. SPI in one paragraph
The Zen SPI master is a classic 4-wire SPI controller — SCLK / MOSI / MISO / CSn — that a client attaches to the common Zen peripheral bus and drives from software. It supports all four CPOL/CPHA modes, programmable 4–16-bit frames, MSB- or LSB-first bit order, and a programmable clock divider that sets the serial rate from the system clock. A single shift engine serializes each frame while sampling the return line, so transmit and receive proceed together on the same clock. Independent TX and RX FIFOs decouple software from the bit-serial rate, and up to four active-low chip-selects let one bus serve several devices, selected per transfer. It follows the same struct-typed, synthesizable convention as the rest of the Zen peripheral family, so it drops into an SoC through an APB4 or AXI4-Lite frontend.
- Zen SPI master
- host / off-chip devices
- TX / RX FIFOs
2. What it is, at a glance
| Element | Detail | Default | Status |
|---|---|---|---|
| Role | SPI master only (slave mode out of scope for v1) | — | exists |
| SPI modes | all four CPOL/CPHA combinations (0–3) | — | exists |
| Frame width | programmable 4–16 bits | — | exists |
| Bit order | MSB-first or LSB-first | — | exists |
| SCLK rate | system clock ÷ (2 × (divider + 1)) | — | exists |
| TX / RX FIFOs | independent, buffered both directions | 8 each | exists |
| Chip-selects | active-low, multi-device, auto- or manual-CS | 4 | exists |
| Interrupts | one line, three enable-gated sources | — | exists |
| Host frontends | native peripheral bus · APB4 · AXI4-Lite | — | exists |
| Sustained max throughput @ node | SCLK-bound; timing sign-off downstream | TBC | TBC |
Sources: Zen SPI product datasheet; as-built RTL.
3. How a client uses it
- Instantiate the core with one host frontend (APB4 or AXI4-Lite); wire the four SPI signals (
SCLK/MOSI/MISO/CSn) to pads or on-chip devices. - Configure mode, frame width, bit order, and clock divider through the control register; set the chip-select mask for the target device.
- Transfer — write frames to queue them into the TX FIFO, read to drain received frames from the RX FIFO. Poll status flags or service the interrupt.
- Scale the bus — add devices on shared SCLK/MOSI/MISO, selecting each per transfer, and choose auto- or manual-CS to match the transaction shape.
4. Verification & provenance
- Mode coverage: all four CPOL/CPHA modes proven byte-exact in both directions against an edge-accurate SPI-slave verification model — transmit captured exactly, receive returned with distinct values so the two directions cannot alias.
- Breadth: 16 of 16 assertion-based tests passing, covering frame width and bit order (8/12/16-bit, MSB and LSB-first), FIFO fill/drain/order, clock-divider edge timing, multi-device chip-select, and all three interrupt sources including read-one-to-clear.
- Gates: functional DV and synthesis checks pass (no inferred latches), independently re-run on the shipped RTL. Internal soft-license; license-ready for external, and offered bundled with UART and I2C in the Serial I/O kit.
Sources read
Sources: Zen SPI product datasheet; as-built RTL.