When speed and device count don't force the choice, the deciding factors are usually practical. First, what interface the part offers, many sensors are I2C-only or SPI-only, and a config pin sometimes picks between them, so availability often decides it outright. Second, the MCU's resources: how many free pins, and how many instances of each peripheral you have left (you might be out of SPI controllers but have I2C free). Third, what's already on the bus, if you already run an I2C bus for other sensors, adding one more I2C device is nearly free, whereas starting a new SPI bus costs pins and a peripheral. Fourth, secondary concerns: I2C gives you ACK-based presence detection and clock stretching for slow devices; SPI gives lower latency and no addressing headaches but no error feedback; UART is simplest for a one-to-one module link. And real boards mix all three, choosing per link rather than standardizing on one. So the abstract comparison narrows it, and then part availability plus your remaining pins/peripherals and existing buses make the final call.
Communication Protocols · Interview question
In practice, how do you decide between two buses when either could work?
A strong answer
What a weak answer sounds like
You know the answer. Do you know what gets you dinged?
Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.
From the lesson
Choosing UART, SPI, or I2C
A side-by-side comparison and a decision framework: pick by speed, device count, pin budget, and distance, and know when none of the three fits and you need CAN or RS-485.
More Choosing UART, SPI, or I2C questions
You need to drive a fast color display. Which bus and why?You have a board with eight sensors, an EEPROM, and an RTC, and very few free pins. Which bus?How does pin count scale differently across the three buses as you add devices?Why are UART, SPI, and I2C all poor choices for sending data across a machine or vehicle?
Browse all 472 interview questions