{"docs":[{"id":112,"title":"I2C, SPI, UART, CAN and USB: Picking the Right Bus","heading":"I2C, SPI, UART, CAN and USB: Picking the Right Bus","subheading":null,"category":"Embedded Systems","body":{"root":{"type":"root","children":[{"type":"heading","tag":"h3","version":1,"children":[{"type":"text","text":"A way to decide","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"For several low-speed sensors on the same board, use I2C and check that the total bus capacitance stays within the 400 pF limit. For displays, flash memory and fast converters, use SPI.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"For a link between two processors or to a debug console, UART is simplest. For anything on a cable in an electrically noisy setting, use CAN or RS-485. For a connection to a computer or phone, use USB.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"tags":"Embedded Systems, Interfaces, Hardware Design","cardCta":{"label":null,"link":null},"pageCta":{"label":"Talk to AAVICO engineering","link":"/contact"},"excerpt":"Each serial bus was designed for a different job. Matching the bus to the distance, speed and number of devices avoids most interface problems.","featuredImage":null,"type":"Blog","readTime":"3 min read","publishedAt":"2026-11-14T18:48:00.000Z","heroImage":null,"introText":"A microcontroller talks to the rest of the board through a handful of serial interfaces, and they are not interchangeable. I2C connects many slow devices with two wires. SPI is fast and simple but needs a wire per device. UART links two points. CAN survives noisy, long cable runs. USB brings standard connectivity to a host. This article compares them with the figures that decide the choice.","metrics":[{"id":"i2c-spi-uart-can-and-usb-picking-the-rig-metric-1","value":"400 kHz","label":"I2C Fast-mode clock rate, the most common setting for sensors.","icon":null},{"id":"i2c-spi-uart-can-and-usb-picking-the-rig-metric-2","value":"2 wires","label":"I2C needs only clock and data, shared by every device on the bus.","icon":null},{"id":"i2c-spi-uart-can-and-usb-picking-the-rig-metric-3","value":"1 Mbps","label":"Maximum bit rate of classic CAN, at bus lengths up to about 40 m.","icon":null},{"id":"i2c-spi-uart-can-and-usb-picking-the-rig-metric-4","value":"480 Mbps","label":"USB 2.0 High-Speed signalling rate; Full-Speed is 12 Mbps.","icon":null}],"gallery":[],"challenge":{"root":{"type":"root","children":[{"type":"paragraph","version":1,"children":[{"type":"text","text":"Problems appear when a bus is used outside what it was designed for. I2C run over a long cable picks up noise and its open-drain edges slow down with capacitance. SPI with many devices consumes a chip-select pin each. UART has no clock, so both ends must agree on the baud rate closely.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"On-board buses also offer no protection against the outside world. Anything that leaves the enclosure needs a bus built for it, with differential signalling and proper protection.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"blockquote":{"quote":"On-board buses stay on the board. Once a signal leaves the enclosure, use an interface designed for cables.","author":null,"role":"AAVICO Engineering"},"supportImage1":null,"deliverables":{"root":{"type":"root","children":[{"type":"paragraph","version":1,"children":[{"type":"text","text":"List each device with the data rate it needs and its distance from the controller.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Assign on-board devices to I2C or SPI by speed, and off-board links to CAN, RS-485 or USB.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Check the electrical limits: pull-up values and capacitance on I2C, trace length on fast SPI, termination on CAN.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"results":[{"id":"i2c-spi-uart-can-and-usb-picking-the-rig-result-1","title":"Reliable Links","description":"Each bus operates inside the conditions it was designed for."},{"id":"i2c-spi-uart-can-and-usb-picking-the-rig-result-2","title":"Pin Efficiency","description":"Shared buses free microcontroller pins for other functions."},{"id":"i2c-spi-uart-can-and-usb-picking-the-rig-result-3","title":"Noise Immunity","description":"Differential buses are used wherever cables and interference are involved."},{"id":"i2c-spi-uart-can-and-usb-picking-the-rig-result-4","title":"Simpler Firmware","description":"Standard buses come with proven drivers and well-understood failure modes."}],"lookingAhead":{"root":{"type":"root","children":[{"type":"paragraph","version":1,"children":[{"type":"text","text":"Plan I2C addresses early. Two devices with the same fixed address cannot share a bus without a multiplexer.","version":1}]},{"type":"paragraph","version":1,"children":[{"type":"text","text":"Bring debug access out on every board: at minimum a UART header and the programming interface.","version":1}]}],"direction":"ltr","format":"","indent":0,"version":1}},"supportImage2":null,"testimonial":{"quote":null,"author":null,"role":null,"photo":null},"challengesSolved":[{"id":"i2c-spi-uart-can-and-usb-picking-the-rig-challenge-1","title":"I2C stretched over a long cable","description":null,"icon":null},{"id":"i2c-spi-uart-can-and-usb-picking-the-rig-challenge-2","title":"I2C address clashes found at bring-up","description":null,"icon":null},{"id":"i2c-spi-uart-can-and-usb-picking-the-rig-challenge-3","title":"SPI running out of chip-select pins","description":null,"icon":null},{"id":"i2c-spi-uart-can-and-usb-picking-the-rig-challenge-4","title":"An unprotected logic signal leaving the enclosure","description":null,"icon":null}],"relatedPosts":[],"contactUs":{"show":true},"updatedAt":"2026-11-14T17:38:33.345Z","createdAt":"2026-11-14T17:38:33.345Z"}],"hasNextPage":false,"hasPrevPage":false,"limit":10,"nextPage":null,"page":1,"pagingCounter":1,"prevPage":null,"totalDocs":1,"totalPages":1}