Home / Peripherals / SPI
ESP32 SPI Guide: HSPI / VSPI Default Pins, Clock Limits and Pitfalls
Which pins HSPI and VSPI default to, how fast you can realistically clock them, and why your display stays black.
How many SPIs does the ESP32 have
The original ESP32 has four SPI peripherals, but only two are yours:
- SPI0 / SPI1: reserved for internal flash and cache. Not available.
- SPI2 (HSPI) and SPI3 (VSPI): free for your peripherals.
Default pins
| Controller | SCLK | MISO | MOSI | CS |
|---|---|---|---|---|
| VSPI (SPI3) — most used | GPIO18 | GPIO19 | GPIO23 | GPIO5 |
| HSPI (SPI2) | GPIO14 | GPIO12 | GPIO13 | GPIO15 |
HSPI's default MISO is GPIO12 — a strapping pin. It sets the internal regulator output voltage at power-up. If your slave drives that line high, the chip may never boot. When using HSPI, move MISO elsewhere or prove your circuitry does not change the level at reset.
How fast can it go
The SPI clock divides down from the APB clock (80 MHz on the ESP32), so the theoretical ceiling is 80 MHz. Reality depends on your wiring: breadboards and Dupont leads struggle past 10 MHz, a short PCB trace manages 40 MHz. Displays typically run at 20–40 MHz. Check the official documentation for exact limits.
This page describes the original ESP32. S2 / S3 / C3 / C6 / H2 / P4 use different SPI numbering and defaults — verify against the documentation for your target.
Handling chip select
- With one slave, hardware CS is fine. With several, give each slave its own GPIO and drive CS in software — hardware CS is a frequent source of multi-device bugs.
- Add a 10 kΩ pull-up on CS so no slave is accidentally selected during power-up.
- Do not skip CS. Some cheap modules claim you can; in noisy environments they lock up.
Display stays black — checklist
- Are you on VSPI (GPIO18/23) rather than the flash pins 6–11?
- DC (data/command) and RST wiring — wrong here is the number one cause of a white screen.
- Drop the clock to 1 MHz. If it comes alive, you have a timing or wiring problem.
- Confirm the display is 3.3 V. A 5 V panel wired straight to the ESP32 may already have damaged the IO.
Data verified:2026-10-20 · Cross-checked against Espressif documentation. Anything that varies between chips or ESP-IDF releases is marked rather than guessed.
Official peripheral docs →
Related
I²CWhich two pins to use for I²C on the ESP32, what pull-up value to pick, and why your device never shows up on the bus scan.UARTWhich pins each of the three UARTs defaults to, why UART1 appears broken, and what to check when flashing fails.RMT (IR & WS2812)RMT is the most underrated ESP32 peripheral: IR remotes, WS2812 strips and one-wire sensors all depend on it. Channels, resolution and the Wi-Fi interference problem.LEDC PWMThe ESP32 LEDC offers 16 PWM channels. Frequency and resolution trade off against each other — here is the maths and recommended values.Deep SleepHow low the current really goes, which pins can wake the chip, and whether your variables survive. Use it with the battery life calculator.