Thesis
Thesis
Bachelor of Technology
In
Electronics and
Communication Engineering
by
Prasanth N. (BT15ECE062)
Snita M. (BT15ECE087)
Keerthana V. (BT15ECE094)
2019
© Visvesvaraya National Institute of Technology (VNIT) 2009
DECLARATION
We hereby declare that this project work titled “RS-232 to HDLC Converter” is
carried out by us in the Department of Electronics and Communication Engineering of
Visvesvaraya National of Technology, Nagpur. The work has not been submitted earlier
whole or in part for the award of any degree/diploma at this or any other
Institution/University.
Prasanth N. (BT15ECE062)
Snita M. (BT15ECE087)
Keerthana V. (BT15ECE094)
Date:
CERTIFICATE
This is to certify that the project titled “RS232 to HDLC Converter” submitted by
in partial fulfillment of the requirements for the award of the degree of Bachelor of
Technology in Electronics and Communication Engineering, VNIT Nagpur. The
work is comprehensive, complete and fit for final evaluation.
We are grateful to a number of people who made this thesis a worthwhile one by
their generosity and benevolence. The list may not be exhaustive, but we would like to
mention people whom we feel indebted to:
We also thank all of our friends who helped us in completing the project. We
would also like to extend our thanks to our family who has been by us throughout the
year.
ABSTRACT
At the transmitter side, the serial asynchronous data is made synchronous with the
help of UART. Next, the HDLC frames are formed from this serial data into a 56-bit
frame. These HDLC frames are next sent into the circular buffer before transmitting
where there is a flexibility of transmitting data with the help of read and write pointers.
Finally, the data is line coded using Manchester coding technique and the 56-bit HDLC
frames are transmitted.
At the receiver, the received HDLC frames in Manchester format are decoded
using Manchester decoder. Using a clock recovery circuit, the clock for the receiver side
is recovered. From the data field of the HDLC frame, the CRC is calculated using the
same polynomial used at the transmitter side and the 16-bit CRC is verified with the
received CRC field to ensure error-free transmission. If the received data is error-free,
then the data field in the HDLC frame is converted to serial RS-232 format using a
parallel to serial converter.
In this way, at the transmitter side, RS-232 serial bits are converted to HDLC
frames and transmitted and at the receiver side, the HDLC frames are converted to
RS-232 serial bits.
List of Figures
Page No
Chapter 1: Introduction
4.1 Conclusion 28
Chapter 6: References
6.1 Papers 47
6.2 Links 47
6.3 Manuals/Books 47
Chapter 1
Introduction
1.1 Introduction to Communication Protocols
A communication protocol is a set of rules that allow two or more communications
systems to transfer information between them. The protocol defines the set of rules, syntax,
and synchronization of the communication systems with error checking methods in some
cases. These protocols may be implemented by hardware, software, or a combination of
both. The information transfer between communication devices through a network is
controlled by these rules that can be set in protocol specifications. In this project, we focus
on two communication protocols namely RS-232 (Recommended Standard 232) and HDLC
(High-level Data Link Control) protocols.
The RS-232 standard defines specific voltage levels for logic one and logic zero.
Valid logic 0 is in the range of +3 to +15 volts and valid logic 1 is in the range of −3 to
−15 volts. The range between −3 to +3 volts is not a valid RS-232 level. It is used in
serial communication up to 50 feet with a rate of 1.492 kbps. They use connectors known
as DB9 Connector.
The voltage levels for the corresponding logic levels are given below:
1.4 UART
The universal asynchronous receiver-transmitter (UART) takes bytes of
asynchronous data and transmits the individual bits in synchronous serial format. In this
data format and transmission, speeds are configurable. UART has a number of
advantages such as:
1. Serial transmission of digital information (bits) through a single wire or other
medium is less costly than parallel transmission through multiple wires.
2. Clock transmission is not necessary.
3. To ensure that the correct data is received it also has parity to allow for error
checking.
This paper is about the building a Manchester decoder and a module which
recovers clock. In the module, using two counters, the time between consecutive edges of
Manchester encoded data is measured. The Manchester half-cycle duration is calculated
using the measured time, which is used to recover the clock. The module receives
Manchester encoded data and generates three signals. One clock of the same frequency as
the input Manchester data. The second clock of double the frequency. The third is the
sequence of decoded data bits.
Fig 1.5 Schematic Representation of Manchester Decoder and
Clock Recovery Module
Fig
1.6 Waveforms Generated by Manchester Decoder and
Clock Recovery Module
From this manual, Manchester encoding has been studied. Manchester encoding
always produces a transition at the center of the bit cell. If the transition is Low to High,
the bit is 0. If the transition is High to Low, the bit is 1.
Chapter 2
Work Done
2.1 Transmitter Side
2.1.1 UART
First, the serial data bits in RS-232 format are given as input to the UART. The
UART appends a start bit ‘1’ and a stop bit ‘0’ for every 8 bits of serial data. Thus, the
serial data becomes synchronous along with the start and stop bits.
Fig 2.2
Finally, a 56-bit HDLC frame is formed for every 8 bits of serial data in RS-232 format.
At the transmitter, the serial data in RS-232 format has been converted to HDLC
frame format. For every 8 bits of serial data, an HDLC frame of 56 bits was formed
which consists of different fields like flag, address, control, data, CRC and these HDLC
frames were transmitted after encoding.
At the receiver, the Manchester encoded data has been decoded and the clock was
recovered. In the received HDLC frames, the 16-bit CRC was calculated for the data field
and checked with the CRC field of the received HDLC frame. The 8-bit data field is
converted to RS-232 serial data, confirming successful transmission of data.
● The control field is left as user-defined and assumed to be ‘10101010’ while when
it comes to implementation, the control field consists of control signals which are
used for error checking purpose.
● The address field also is left as user-defined and assumed to be ‘10101010’. It
generally consists of the destination address of the port to which the data frame is
to be transmitted.
● The data field we have considered is of 8 bits and which can be extended to 16 or
32 bits.
● For error detection, we have used a 16-bit CRC which can be extended to 32 bits
for better error correction.
● The circular buffer size can be increased so that the number of HDLC frames can
be stored in it increases.
Chapter 6
References
6.1 Papers
6.2 Links
[2] https://en.wikipedia.org/wiki/RS-232
[3] https://nptel.ac.in/courses/106105080/pdf/M3L4.pdf
[5] www.zilog.com/docs/serial/z85c30.pdf
[6] https://www.geeksforgeeks.org/computer-network-manchester-encoding/
[7] https://web.stanford.edu/class/cs140e/notes/lec4/uart-basics.pdf
[8] https://en.wikipedia.org/wiki/Cyclic_redundancy_check
[9] https://docslide.us/documents/manchesterdecoderandclockrecoveryageev.html?h=
docslide.com.br
7.3 Manual/Books