Serial Is An Umbrella Word For All That Is "Time Division Multiplexed", To Use An
Serial Is An Umbrella Word For All That Is "Time Division Multiplexed", To Use An
Serial Is An Umbrella Word For All That Is "Time Division Multiplexed", To Use An
expensive term. It means that the data is sent spread over time, most often
one single bit after another. All the protocols you're naming are serial protocols.
UART, for Universal Asynchronous Receiver Transmitter, is one of the most used
serial protocols. It's almost as old as I am, and very simple. Most controllers
have a hardware UART on board. It uses a single data line for transmitting and
one for receiving data. Most often 8-bit data is transferred, as follows: 1 start
bit(low level), 8 data bits and 1 stop bit(high level). The low level start bit and
high level stop bit mean that there's always a high to low transition to start the
communication. That's what describes UART. No voltage level, so you can have
it at 3.3 V or 5 V, whichever your microcontroller uses. Note that the
microcontrollers which want to communicate via UART have to agree on the
transmission speed, the bit-rate, as they only have the start bit's falling edge to
synchronize. That's called asynchronous communication.
For long distance communication (That doesn't have to be hundreds of meters)
the 5 V UART is not very reliable, that's why it's converted to a higher voltage,
typically +12 V for a "0" and -12 V for a "1". The data format remains the
same. Then you have RS-232 (which you actually should call EIA-232, but
nobody does.)
The timing dependency is one of the big drawbacks of UART, and the solution
is USART, for Universal Synchronous/Asynchronous Receiver Transmitter. This
can do UART, but also a synchronous protocol. In synchronous there's not only
data, but also a clock transmitted. With each bit a clock pulse tells the receiver
it should latch that bit. Synchronous protocols either need a higher bandwidth,
like in the case of Manchester encoding, or an extra wire for the clock, like SPI
and I2C.
SPI (Serial Peripheral Interface) is another very simple serial protocol. A master
sends a clock signal, and upon each clock pulse it shifts one bit out to the slave,
and one bit in, coming from the slave. Signal names are therefore SCK for
clock, MOSI for Master Out Slave In, and MISO for Master In Slave Out. By
using SS (Slave Select) signals the master can control more than 1 slave on the
bus. There are two ways to connect multiple slave devices to one master, one is
mentioned above i.e. using slave select, and other is daisy chaining, it uses less
hardware pins(select lines), but software gets complicated.
About each of these you can write a book, and it looks I'm well on my way. This
is just a very brief overview, let us know if some things need clarification.