Foundations · Lesson 6 of 11 · about 12 min

UART, I2C and SPI

How chips talk to each other

A microcontroller needs to talk to sensors, screens, memory cards and your computer. Almost everything uses one of three standard buses.

The BoardPilot Learn screen: a lesson with its 3D board preview
Try it live

The real app, running in your browser: this lesson with its 3D preview on a simulated ESP32 DevKit (30 pins). No install, nothing to plug in.

UARTI2CSPI
Wires22, shared3, plus 1 per device
Devices2Many, by addressSeveral, by select wire
SpeedSlowMediumFast
Typical useDebug messages to the computer, GPSSensors, small screensSD cards, displays

Each bus is a peripheral inside the MCU: you write a byte into its data register and the hardware sends it bit by bit. When a byte arrives, it can raise an interrupt. Same pattern as always: registers and interrupts.

Interview questions

  1. When would you choose SPI instead of I2C?
  2. Why does I2C need pull-up resistors?
  3. What does a NACK on the I2C bus tell you?

No answers here on purpose: try answering out loud first. In the BoardPilot app, the interview coach reads your own answer and tells you what was right, what is missing and what a senior interviewer would ask next (it uses the AI provider you choose in the app). Embedded systems interview questions →

Key terms

In the app, the lessons come alive

The lessons have interactive demos and hands-on labs checked on your board in the app. These pages are the readable version: the demos are described in words, and the labs need the app.

Download BoardPilot Try the lessons in your browser