Electronic – General protocol for data transfer from one system to another


What is the general protocol to send information from one system to another? For example, let's say we have some information collected from microcontroller over a length of time that we want to send to another microcontroller. I've heard of SPI and I2C interfaces, but I am unclear when you use one method over another and how you implement it. Are there other methods besides SPI and I2C that are common? Is the implementation process similar for different microcontrollers? Is it basically parsing bytes of data that I am doing on the receiving microcontroller?

Best Answer

SPI and I2C are kind of similar, in that they're really used more for attaching peripheral devices to a controller or cpu, than for actually transferring data between systems. USB is another interface that people seem to want to treat as a communication system, which is in fact a peripheral attachment bus.

Communication between systems isn't exactly like attaching a device to a bus. Bus attachment allows the processor to directly bang on registers in a device, whereas a communication interface allows you to send/receive streams of data. A device connected on a bus generally needs a device driver, whereas with communications, it really doesn't matter what is connected on the other end, as far as the host computer is concerned.

Of course, this is getting to be a hazier boundary all the time. Things like PCI and ISA are indisputably buses; I2C, SPI, USB are arguably buses; whereas RS232, RS485, and ethernet are definitely communications interfaces. But then there are things like CAN bus and 1553, which are definitely about moving data around, but in a very involved kind of way.