Skip to content

SPI Timing & Signal Integrity Calculator

Calculate SPI bus timing parameters including bit period, frame time, maximum clock frequency limited by trace capacitance, and signal slew rate

First-order RC edge, t_r = 2.2RC · R_drive = 3.3 V/I_driveAPI slug spi-timing

Sign in to saveSave

Inputs

Example
SPI SCLK frequency in MHz

1 kHz or more

Number of data bits per SPI frame
bits

1 to 32 bits

Estimated total capacitive load on the signal line (PCB trace + receiver)

100 fF or more

GPIO output drive current capability in mA

100 µA or more

Max Freq (RC-limited)PASS
13.77MHz
at least 10 MHz
Edge Time (10–90 %)
36.3ns
Bit Period
100ns
Frame Period
800ns
Signal Slew Rate
0.09091V/ns

One word in mode 0

CSSCLK3.5 V0 VMOSID7D6D5D4D3D2D1D010100101bit 100 nst_r 36.3 nsword 800 ns0 s200 ns400 ns600 ns800 ns

sample point · Edge Share of Half Period t_r/(tbit/2) 72.6 %

Standard values of SPI Clock Frequency

Select a row to use it
SPI Clock FrequencyBit PeriodFrame PeriodEdge Share of Half PeriodStatus
1µs8µs7.26%PASS
500ns4µs14.5%PASS
200ns1.6µs36.3%PASS
100ns800ns72.6%PASS
50ns400ns145%CHECK
40ns320ns182%CHECK
20ns160ns363%CHECK
Data Ratefdata
10Mbps

Formula

tbit=1/fCLK,τ=Rdrive⋅Ctrace,fmax=1/(4.4τ)t_{bit} = 1/f_{CLK},\quad τ = R_{drive}·C_{trace},\quad f_{max} = 1/(4.4τ)
SymbolQuantityYour value
tbitBit period (ns)100 ns
τRC time constant (ns)—
RdriveDrive output impedance (3.3V/I_drive) (Ω)—
CtraceTotal trace capacitance (F)20 pF
fmaxMaximum clock frequency (Hz)13.77 MHz

Assumptions

5 items
  1. 01The driver is modelled as a resistance R = 3.3 V/I_drive charging the trace capacitance, a first-order RC edge with τ = RC; that reads a 4 mA output as 825 Ω, slower than a CMOS output usually is (V_OL/I_OL), so the edge is a slow bound.
  2. 02The 10–90 % edge is 2.2τ, and the RC-limited maximum clock is where that edge fills the half period, 1/(4.4τ); the slew rate is 3.3 V over 2.2τ.
  3. 03The bit period is 1/f_SCLK, a word takes its width in bit periods, and the data rate is one bit per clock on one wire.
  4. 04Not modelled: the trace's flight time, which a slave's reply on MISO travels twice, the slave's clock-to-output delay, setup and hold times, and reflections on a long line.
  5. 05The drawing is one word in mode 0: CS low for the word, SCLK idle low with the RC edges, MOSI MSB first, changing on the falling edges and sampled on the rising ones.

Worked example

SPI flash at 20 MHz, 15 pF, 8 mA

A microcontroller drives an SPI flash at 20 MHz with an 8 mA output into 15 pF of trace and input. How long is the clock edge, and how much of the half period does it take?

StepExpressionResult
Drive resistance and time constant3.3 V/8 mA × 15 pF6.19 ns
10–90 % edge2.2 × 6.19 ns13.61 ns
RC-limited maximum clock1/(2 × 13.61 ns)36.73 MHz
The edge's share of the half period13.61 ns/(50 ns/2)54.4 %

How it works

This calculator determines SPI clock frequency limits, setup/hold times, and data transfer rates for reliable master-slave communication. Embedded engineers and FPGA designers use it to verify timing margins between microcontrollers and peripheral ICs. Per the original Motorola SPI specification (now maintained by individual IC manufacturers and documented in NXP application note AN3020 'Interfacing to the SPI'), the protocol uses 4 signals: SCLK, MOSI, MISO, and CS. Although SPI has no single governing ISO/IEC standard, the de-facto timing parameters are documented in Microchip application note AN901 and the JEDEC standard JESD79F for SPI-compatible memories defines timing requirements for high-speed flash and SRAM devices. Clock frequencies range from 100 kHz to 100 MHz depending on device capabilities - typical flash memories support 50-133 MHz (Winbond W25Q series), while ADCs often limit to 1-20 MHz. Critical timing parameters include t_setup (data valid before clock edge, typically 5-25 ns), t_hold (data valid after clock edge, typically 5-15 ns), and t_clk (minimum clock period). A 10 MHz SPI clock provides 100 ns period, allowing 40 ns setup, 40 ns hold, and 20 ns margin. At 50 MHz, these margins shrink to 8 ns each, requiring careful PCB layout with trace matching within 1 ns (15 cm).

Practical tips

  • Per Microchip AN1067, keep SPI trace lengths under 10 cm for frequencies above 10 MHz to maintain timing margins above 5 ns
  • Use CPOL=0, CPHA=0 (Mode 0) as the default - 85% of SPI peripherals support this mode per industry surveys
  • Add 33-100 Ohm series termination resistors on SCLK and MOSI for traces longer than 5 cm at frequencies above 20 MHz to reduce ringing by 60-80%

Common mistakes

  • Running SPI at maximum MCU frequency (e.g., 50 MHz) without checking slave device limits - many sensors are limited to 1-10 MHz
  • Ignoring CPOL/CPHA mode mismatch: Mode 0 vs Mode 3 causes 100% data corruption despite similar-looking waveforms
  • Using long (>30 cm) unshielded cables at frequencies above 1 MHz, introducing 10-50 mV crosstalk that corrupts LSBs

Frequently asked questions

3 questions
What is the maximum SPI clock speed?

Device-dependent: microcontrollers typically support 25-50 MHz, SPI flash memories reach 133 MHz (Quad SPI), and FPGAs can exceed 200 MHz. The practical limit is set by the slowest device in the chain and PCB parasitics (typically 1-2 pF/cm trace capacitance).

How many devices can be connected to an SPI bus?

Limited by CS lines and bus capacitance. Each device adds 5-15 pF load capacitance. At 50 MHz, total bus capacitance should stay under 30 pF (about 3-5 devices). Using a 74HC138 decoder allows 8 devices with only 3 GPIO pins.

What are the key SPI timing parameters?

t_setup (5-50 ns typical): data must be stable before clock edge. t_hold (5-25 ns typical): data must remain stable after clock edge. t_clk_min (8-1000 ns): minimum clock period. t_css (20-100 ns): CS setup time before first clock. t_csh (20-100 ns): CS hold time after last clock.

Shop Components

As an Amazon Associate we earn from qualifying purchases.

  • USB-UART AdapterUSB to serial adapter for protocol debugging and flashingAmazon →
  • USB Logic Analyzer8-channel USB logic analyzer for capturing digital bus trafficAmazon →