SERIAL
INTERFACES
SERIAL COMMUNICATION
• This is the process whereby data is sent sequentially, one
bit at a time over a communication channel or computer
bus.
• A single data bus is required to send data, this make the
serial communication more cheaper but slow as it sends
one bit at a time.
• Serial method is mostly used for long distance
communication, but with new technologies it is even used
for short distances.
• Serial interface fig 12.1
PARALLEL COMMUNICATION
• They send a group of bits simultaneously over a link of several parallel
channels.
• More data busses are required to send data in parallel communication. This
makes it a more expensive method as compared to serial communication
method. The parallel communication method is more faster as several bits of
data are transferred at the same time.
• The synchronization difficulties has made a parallel communication impractical.
• This problem is overcome by synchronizing the clock of the receiver with that
of the transmitter.
• Synchronization is made possible with the use of interface or line adapter.
INTRODUCTION
• In today’s world being able to communicate is not just about talking to
people but also to be able to communicate with the aid of a computer –
sending emails, documents, presentations, etc.
• Different types of communication takes place within a computer.
• To be able to communicate, there must be networks, meaning computers
must be interfaced correctly.
• Data is saved in binary form on memory devices. How the data is
transferred or send can affect overall performance of the computer
• There are two types of communication processes that can be utilised i.e.
Serial and Parallel.
TYPES OF INTERFACE
DEVICES
• Universal asynchronous receiver transmitter (UART)
• Universal synchronous asynchronous receiver transmitter
(USART)
• UART can be used only for asynchronous transmission
• USART can be used for both synchronous and
asynchronous transmission.
ASYNCHRONOUS SERIAL TRANSMISSION
• Different types of serial interface
• Universal Serial Bus (USB)
• Ethernet
• Serial Peripheral Interface (SPI)
• Inter-integrated Circuit (I2C)
• Controller Area Network (CAN)
• Recommend Standard 232 (RS-232)
Serial Peripheral Interface (SPI)
• SPI is used to enable exchange of data between the
master and the slave.
• They are bidirectional, and it is used for communication
between computers and peripheral devices.
• SPI-bus is a simple 4-wire serial communications interface
used in many microprocessors or microcontroller
peripheral chips.
Inter-integrated circuit (I 2C)
• I 2 C bus is often used to communicate across circuit-board distances. They are
used as ‘inside the box’ interfaces.
Controller Area Network (CAN)
• Are used for fast data exchange between electronic controllers in motor
vehicles.
Recommend Standard 232 (RS-232C)
• RS-232 is a standard describing the most widely used type of serial
communication. It is used for asynchronous data transfer as well as
synchronous transfers.
• The C is the latest revision of the standard RS232.
• The RS232 line protocol is very popular for low speed data signals.
• The RS232 operates within -12V and +12V, voltages between -3V and +3V are
considered inoperative and absorb line noise. Control signals are considered
operative when voltage ranges between +3V and +25V
• RS232 line protocol is unbalanced, because it uses one wire and is susceptible
to signal degradation.
SYNCHRONOUS AND ASYNCHRONOUS
Serial interfaces can be sorted into one of two groups: Synchronous or Asynchronous.
Synchronous serial interface always pairs data line(s) with the clock signal, so all devices on a synchronous serial bus share a common clock. This
makes for a more straight-forward, often faster, but it also requires at least one extra wire between communicating devices.
• Examples of synchronous interfaces include SPI and I2C
Asynchronous means that data is transferred without support from an external clock signal. This transmission method is perfect for minimizing the
required wires and I/O pins, but it does mean we need to put some extra effort in reliably transferring and receiving data. The serial protocol we’ll be
discussing here is the most common form of asynchronous transfers. It is so common, in fact, that when most folks say “serial” they’re talking about
this protocol.
Rules of Serial Transmission
• The asynchronous serial protocol (set of rules) has a
number of built-in-rules – mechanisms that help ensure
robust and error-free data transfers. These mechanisms
are:
• Data bits
• Synchronization bits
• Parity bits
• And Baud rate
Baud Rate
• The baud rate specifies how fast data is sent over a serial line. It’s
usually expressed in units of bits-per-second (bps). This value
determines how long the transmitter holds a serial line high/low or
at what period the receiving device samples its line.
• Baud rates can be just about any value within reason. The only
requirement is that both devices operate at the same rate.
• The higher a baud rate goes, the faster data is sent or received,
but there are limits to how fast data can be transferred.
• Framing the data: refer to table 12.1 pg 219
Data Chunk
• The real meat of every serial packet is the data it carries.
We ambiguously call this block of data a chunk, because
its size isn’t specifically stated. The amount of data in
each packet can be set to anything from 5 to 9 bits.
Certainly, the standard data size is your basic 8-bit byte,
but other sizes have their uses. A 7-bit data chunk can be
more efficient than 8, especially if you’re just transferring
7-bit ASCII characters.
• After agreeing on a character-length, both serial devices
also have to agree on the order in which their data is sent.
Synchronization bits
• The synchronization bits are two or three special bits
transferred with each chunk of data. They are the start bit
and the stop bit(s). True to their name, these bits mark the
beginning and end of a packet. There’s always only one
start bit, but the number of stop bits is configurable to
either one or two(though it’s commonly left at one).
• The start bit is always indicated by an idle data line going
from 1 to 0, while the stop bit(s) will transition back to the
idle state by holding the line at 1.
Parity bits
• Parity is a form of very simple, low-level error checking. It
comes in two flavors: odd or even. To produce the parity
bit, all 5-9 bits of the data byte are added up, and the
evenness of the sum decides whether the bit is set or not.
For example, assuming parity is set to even and was being
added to a data byte like 01011101, which has an odd
number of 1’s (5), the parity bit would be set to 1.
Conversely, if the parity mode was set to odd, the parity
would be 0.
Wiring and Hardware
• A serial bus consists of just two wires-one for sending data and
another for receiving. As such, serial devices should have two
serials pins: the receiver, RX, and the transmitter, TX (see fig 12.3).
• It’s important to note that those RX and TX labels are with respect
to the devices itself. So the RX from one device should go to the TX
of the other, and vice-versa. The transmitter should be talking to
the receiver, not to another transmitter.
• A serial interface where both devices may send and receiver data is
either full-duplex or half-duplex.
Hardware Implementation
• There are all sorts of standards for serious signaling. Let’s look at a couple of the more
popular hardware implementations of serial: logic-level (TTL) and RS-232.
• When microcontrollers and other low-level ICs communicate serially they usually do so
at a TTL level. TTL serial signals exist between a microcontroller’s voltage supply
range – usually 0V to 3,3V or 5V. (see fig 12.4)
• RS-232, which can be found on some of the more ancient computers and peripherals, is
like TTL serial flipped on its head. RS-232 signals usually range between -13V and 13V,
though the specification allows for anything from+/- 3V to +/- 25V. (see fig 12.5)
• Between the two serial signal standards, TTL is much easier to implement into
embedded circuits. However, the low voltage levels are more susceptible to losses
across long transmission lines. RS-232, or more complex standards like RS-485, are
better suited for long range serial transmissions.
UARTS
• The final piece to this serial puzzle is finding something to both create the serial packets and control those physical
hardware lines. Enter the UART.
• A universal asynchronous receiver/transmitter (UART) is a block of circuitry responsible for implementing serial
communication. Essentially, the UART acts as an intermediary between parallel and serial interfaces. On one end of
the UART is a bus of eight-or-so data lines (plus some control pins), on the other is the two serial wires – RX and TX.
(see fig 12.6)
• UARTs do exist as stand-alone ICs, but they’re more commonly found inside microcontrollers. You’ll have to check your
microcontroller’s datasheet to see if it has any UARTs. Some have none, some have one, some have many.
• As the R and T in the acronym dictate, UARTs are responsible for both sending and receiving serial data.
• More advanced UARTs may throw their received data into a buffer, where it can stay until the microcontroller comes
to get it. UARTs will usually release their buffered data on a first-in-first-out(FIFO)basis. Buffers can be as small as a
few bits, or as large as thousands of bytes.
• The 8251 is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data communication. As a
peripheral device of a microcomputer system, the 8251 receiver parallel data from the CPU and transmit serial data
after conversion. This device also receives serial data from the outside and transmits parallel data to the CPU after
conversion. (see fig 12.8)
Modems
• Before the days of broadband Internet connections, most computers connected to the Internet via
telephone lines (dial-up connections). The problem with using telephone lines is that they are
designed to carry voices, which are analogue signals (fig 12.9). They are not designed for digital
data.
• A modem contains a DAC and an ADC.
• The DAC in the modem is required so that the digital computer can send data down the analogue
telephone line(it converts digital data into noises which is exactly what the telephone line is
designed to carry).
• The ADC in the modem is required so that the analogue signals(noises) that arrive via the
telephone line can be converted back into digital data.
• The reason telephone lines were used is that almost every building in the world is already joined to
every other via the telephone system. Using the telephone system for connecting computers meant
that people didn’t have to install new wires to their houses and offices just for computer use.
Operation
• The Data Terminal Equipment or DTE(better known as a computer)
sends a Ready To Send (RTS) signal to the Data Communication
Equipment(DCE-better known as a modem). This is sometimes
known as a wakeup call and results in the modem sending a Data
Carrier Detect(DCD) signal to the receiving modem. A series of
signal passes between the two until the communication channel has
been established. This process is known as handshaking. Thereafter
the second modem sends a Data Set Ready (DSR) signal to its
computer and waits a Clear To Send(CTS) signal to the computer
that started the whole process and data is then be transmitted.
Transferring the data
• Since the telephone lines are analogue, it constantly
changes. The computer, on the other hand, is digital and
will only understand the data if presented with a string of
0s and 1s. This means the binary data of 0s and 1s must
be mapped onto the analogue signal. This is called
modulation - a process where different frequencies
representing different groups of binary digits are
superimposed onto the analogue signal (known as the
carrier wave). Once its done, it is transmitted.
Types of Modem
1. Directional capacity: half duplex modem and full duplex
modem.
2. Connections to the line: 2-wire modem and 4-wire
modem.
3. Transmission mode: asynchronous modem and
synchronous modem.
Simplex, Half duplex and Full
duplex modems
• Simplex:
In simplex transmission, data flow only in one direction –
from the sending device to the receiving device.
Simplex transmission is used only when the sending device
does not require a response from the receiving.
Half duplex
• Half-duplex provides the capability to transmit information
in two directions but only in one direction at a time(e.g.,
with a pair of walkie-talkies). In half-duplex transmission,
data can flow in either direction – from the sending device
to the receiving device, and back – but only in one
direction at a time.
Full duplex
• Full duplex, also referred to simply as duplex, involves a
four-wire circuit, and it provides the capability to
communicate in two directions simultaneously. There’s an
individual transmit and receive path for each end of the
conversation . Therefore, no line turnarounds are
required, which means full duplex offers the most efficient
form of data communication.
Asynchronous & Synchronous
modems
Asynchronous modem
Can handle data bytes with start and stop bits.
There is no separate timing signal or clock between the
modem and the DTE.
The internal timing pulses are synchronized repeatedly to
the leading edge of the start pulse. (see fig 12.12)
Synchronous modem
• Can handle a continuous stream of data bits but requires a
clock signal.
• The data bits are always synchronized to the clock signal.
• There are separate clocks for the data bits being
transmitted and received.
• The DTE can use its internal clock and supply the same to
the modem.
(see fig 12.13)
Modulation techniques used for
modem
• Amplitude shift keying (ASK)
• Frequency shift keying (FSK)
• Phase shift keying (PSK)
• Differential PSK (DPSK)
• These techniques are known as the binary continuous
wave(CW) modulation.
PORTS
• A port is a connection point where data can be sent or received. It can
refer to both hardware ports and software ports: • ⚙️Functions of Ports
• 1. Hardware Port • Whether hardware or software, ports serve key roles:
• - A physical interface on a computer where peripherals (external • 🔌 Hardware Ports
devices) connect.
• - Allow external devices to communicate with the computer.
• - Examples include USB ports, HDMI ports, audio jacks, etc.
• - Enable transfer of data, power, or signals.
• 2. Software Port
• - Examples: Connecting a printer via USB, or a monitor via HDMI.
• - A logical channel used in networking to identify specific services or
• 🌐 Software Ports
applications.
• • - Direct incoming and outgoing network traffic to the right application
- Each service (like a web server or email client) uses a particular port
or service.
number so data knows where to go.
• • - Help multiple services run simultaneously on a single system by using
- For example, HTTP commonly uses port 80, and HTTPS uses port 443.
unique port numbers.
Examples of Common Ports
• 🎯 | Type | Port Name | Purpose |
• | Hardware | USB | General data transfer + charging |
• | Hardware | HDMI | Video/audio output to displays |
• | Hardware | Ethernet | Wired internet connection |
• | Software | Port 80 | HTTP web traffic |
• | Software | Port 443 | Secure HTTPS web traffic |
• | Software | Port 25 | Email via SMTP |
The difference between a Port and interface device
| Feature | Port | Interfacing Device |
| Role | Connection point for signals/data | Converts/mediates communication between
systems |
| Example | USB port | USB-to-serial converter |
| Location | On the computer or peripheral | Can be external or built-in hardware |
| Complexity | Generally simple (plug and play) | May include logic to translate protocols |
- A port is like a doorway, while an interfacing device is like a translator that helps two
systems understand each other across that doorway.
- For instance, a serial-to-USB adapter lets a computer talk to a device that only speaks
serial — here, the adapter is the interfacing device, and the USB port is just the entry
point.