-2
\$\begingroup\$

I have been using I2C and SPi for a few years now, but as I begin working with USB, I realize it is much faster. I still see devices with 2 MCUs that could potentially communicate faster with USB, but still interface with SPI.

Why aren't we just using USB with PHYs everywhere, even between same board ICs? Is it because USB is expensive to implement/time consuming? Or is there any advantages to older protocols I am not seeing? Am I right to say that theoretically, everything would be faster if we only used USB for everything?

Thanks a lot!

\$\endgroup\$
4
  • 2
    \$\begingroup\$ Explain how systems where I2C and SPI are more than fast enough would benefit from USB. I suggest that you study the differences between I2C, SPI and USB. Your conclusion should be that I2C and SPI are cheaper as they are less complex and require less silicon area (so cost less) to implement. Also, USB requires a hub for multiple devices. I2C and SPI don't. If I2C or SPI isn't fast enough, even then many ICs do not use USB as there are more suitable protocols for communication between ICs. Faster doesn't always mean "better". \$\endgroup\$ – Bimpelrekkie Dec 15 '20 at 21:51
  • 6
    \$\begingroup\$ "since we now have cars, we don't walk from the bedroom to the kitchen anymore" would be the equivalent statement to "since we now have USB, why would we use SPI?" \$\endgroup\$ – Marcus Müller Dec 15 '20 at 22:00
  • 1
    \$\begingroup\$ Yeah, battery drain would be way faster on battery powered devices. Are faster battery sales desirable? \$\endgroup\$ – Andrew Morton Dec 15 '20 at 22:00
  • 2
    \$\begingroup\$ Because USB is hardware intensive, resource intensive, complicated, with overhead and latency. \$\endgroup\$ – DKNguyen Dec 15 '20 at 22:53
3
\$\begingroup\$

Not all MCUs have built-in USB PHYs. Even if they did, the hierarchical model of USB software stack and implementing a proper host on one device and proper device on another would potentially be too awkward for simple data transfer between two MCUs or between MCU and other chips. The model would suit poorly to many situations. For example what kind of USB device would a DAC chip, memory chip, real-time clock chip or temperature sensor enumerate as, and how would you access the fearures they provide? With I2C and SPI, you simply read and write register addresses and data values they contain.

Many PHYs inside MCUs are also only capable of 12Mbps and many MCUs with 12Mbps PHYs also have SPI peripherals that can potentially transfer faster than 12Mbps.

Also USB connectivity is limited to chips meant to be directly connected to computers and alike devices, and there are many chips that are not meant for that so these don't have USB - like simpler sensors and even more complex chips that just need to be controlled by MCU.

Implementing USB for everything would not make things faster. For example USB UART chips already have latency issues and must include FIFO buffers to cope with the fact that USB transfers happen only every 1ms, and at 3 Megabauds that's already 300 bytes it must store for reception or data loss will happen. For transmission, if the FIFO is smaller than 300 bytes, no bytes are lost, but it can't provide 3Mbps throughput.

\$\endgroup\$
3
  • \$\begingroup\$ Thanks! I didn't think about USB devices and the fact that USB isn't just for embedded systems afterall, but for PCs too which are much faster. \$\endgroup\$ – JCSB Dec 16 '20 at 0:29
  • \$\begingroup\$ but for PCs too which are much faster. That's not the reason to use USB. The reason why USB is used is ease-of-use and higher data transfer rates than its predecessors (serial and parallel connections, who remembers those?). A PC is "fast" yet there are I2C and similar ("slow") busses present in every PC. They're used there where that is appropriate and USB is not. \$\endgroup\$ – Bimpelrekkie Dec 17 '20 at 12:08
  • \$\begingroup\$ And a PC motherboard could still use I2C (or in fact more likely SMBUS variant of it) for temperature/fan/voltage sensors and SPI flash chip for storing the BIOS. \$\endgroup\$ – Justme Dec 17 '20 at 12:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.