An Introduction To Serial Port Interfacing
An Introduction To Serial Port Interfacing
An Introduction To Serial Port Interfacing
SERIAL PORT
INTERFACING
An Introduction to Serial
communication
As the name implies, in the Serial
communication you send bits of data serially
i.e. one bit at a time.
Normally we predefine rate of transfer such
as
2400 bits/sec. (2400bps)
56,000 bits/sec. (56 kbps)
And then depending upon this rate we
interpret bits boundaries.
Example of Serial Waveform
For example you receive following waveform
from serial port of your PC and it is stated that
data rate is 2400bps
Methods of timing used to find bit
boundaries
Synchronous communication
Asynchronous Communication
In Asynchronous communication the sender
and receiver decide a data rate before
communication. They decide upon signaling
used for start & stop of data transmission.
Both sender & receiver use a precise timing
reference internally to divide serial received
data into bits.
Basics of Serial Communication
Baud Rate
The baud rate is simply “the rate of data transmission
expressed in bits per second, kilo Bits per second or
Mega bits per second etc”.
The sender & receiver decide upon no of bits in one data
word such as 8 bits (1byte) etc. More over they decide
that:
A first bit before transmission of data word will always be
0 (or 1) after which data bits will follow. It is called start
bit.
The last bit followed by data bits will always be 1(or 0)
after which it requires start bit for transmission of next
word. This bit is called stop bit
Advantage of Start / Stop bits
Some measures for error detection
Parity
Is of two types
1. Even parity
2. Odd parity
Suppose your data word is 8 bit in length i.e. one byte.
The sender, before transmitting byte, determines whether the no of bits
in the byte to be sent are even. Suppose sender’s wants to send
10011101
In which there are 5 “ 1’s ” and 3 “ 0’s ”.
To keep the no. of 1’s even the sender adds an extra bit at the end of
byte so that the total no. of 1’s are 6 (an even no.). This extra bits is
called parity bit. Since this bit keeps the no. of 1’s even, so it is called
even parity.
Overview of total bits with Parity
Odd Parity
Odd parity is added to keep the no. of 1’s odd in transmission. For
example for above case of data being
10011101
The odd parity will be added as 0 as no of 1’s are already 5 (an odd
no.).
Failure of Parity