The document discusses a summer internship project involving designing a chat application that allows multiple users to communicate through serial ports. It then provides background information on various serial communication standards and concepts like RS-232, null modems, MAX232 chips, and how asynchronous serial communication works by transmitting data one bit at a time with start and stop bits. It also describes how a letter would be transmitted from one PC to another via their serial ports as a sequence of bits including the ASCII code for the letter surrounded by start and stop bits.
1. Summer Internship 2014
Project: Data Communication through serial port.
Group members (Internees):
Sana Ghani.
Wajiha Muzzaffar Ali.
Sadia Sami.
Areeba Sharif.
Projectdesign:
To design a chat application based on C-sharp .NET framework. It would have basic structure
that would enable multiple users to chat with one another through serial port interface.
Multiple computers (three) would have access to chat.
Project Requirements:
RS 232C serial cable
Null modemcable
Three computers
PARALLEL PORT
Advantages:
Parallel Port communication is faster as 1 Byte (8 bits) can be transmitted at a time.
Parallel port transfers data with data ready and data received handshake lines thus;
they go fast as the processor can deliver up to a fixed clock frequency.
Disadvantages:
2. It isn’t reliable for transmitting data over long distances and if anyone of the bit has
been damaged during transmission it will affect the whole data.
It has higher wiring requirements so it consumes more space and hence it is costly.
COM PORT/ SERIAL PORT:
Advantages:
The losses in the cable when transmitting data using serial port are less substantial.
Another proof of serial port universality is microcontrollers. Many of them have
inbuilt SCI (Serial Communications Interfaces), used for communication with other
devices.
The number of wires needed when transmitting data serially is less than when the
transmission is parallel.
Disadvantages:
Surely enough serial port has its drawbacks. The main one is that when organizing
serial connection it is always necessary to convert the data into serial code and vice
versa.
RS232C:
RS-232 stands for Recommend Standard number 232 and C is the latest revision of the
standard. The serial ports on most computers use a subset of the RS-232C standard.
The full RS-232C standard specifies a 25-pin "D" connector of which 22 pins are used.
Applications: Today, it is still widely used in embedded computer development
systems, scientific instruments, and all sorts of industrial control equipment.
DCE and DTE Devices:
3. DTE stands for Data Terminal Equipment, and DCE stands for Data Communications
Equipment. These terms are used to indicate the pin-out for the connectors on a device and
the direction of the signals on the pins. Your computer is a DTE device, while most other
devices are usually DCE devices.
RTS / CTS:
RTS line is switched between mark and space condition by DTE devices to ensure data
transmission and similar for DCE devices. While CTS make sure receiver buffer isn’t full for
transmission with respect to DTE/ DCE devices.
NULL Modems:
If you connect two DTE devices (or two DCE devices) using a straight RS232 cable, then the
transmit line on each device will be connected to the transmit line on the other device and
the receive lines will likewise be connected to each other. A Null Modem cable or Null
Modem adapter simply crosses the receive and transmit lines so that transmit on one end is
connected to receive on the other end and vice versa. In addition to transmit and receive,
DTR & DSR, as well as RTS & CTS are also crossed in a Null modem connection.
RS485:
It defines notonly a single device-to-device interface but also a communications bus thatcan
be usedto form simple networksof multiple devices. Its configuration and specifications
also extend the rangeand data rate beyond the RS-232 interface capabilities. Full-duplexor
simultaneoustransmitand receive operations can be implemented with a two-pair cable.
Applications: It is particularly effective in equipment used in noisy environments such as
factories, process control plants, and utilities sites.
RS422
RS-422 is a variation of RS-485 with similar specifications butis designed only for one driver
and up to 10 receivers. Otherwise, other specifications are similar to the RS-485 interface.
4. USB TO RS232 CONVERTER
This converter plugsinto your computer’s USB port andprovides you with a DB-9 RSR232
connection. The cable will enumerateas a COM port with a baudrate adjustableto whatever
setup you want to connect to.
USB TO TTL CONVERTER
This USB to TTL converter is a port-powered bi-directional USB to TTL/CMOS 5V converter,
which can be used to convert any standard full-duplex USB port into a full-duplex TTL port and
vice versa. The unit is powered from the USB port and it supports data auto-sensing & self-
adjusting, and therefore, no baud rate setting is required.
Q. Do you understand the serial mode of communication? How the PC will transfer a letter
(say 'Á') to the other PC using serial port?
Serial communication is forms of I/O in which the bits of a byte begin transferred appear one
after the other in a timed sequence on a single wire. It has become the standard for
intercomputer communication.
There are two types of serial communication:
Synchronous communication
Asynchronous communication
In synchronous communication the data is transmitted and received through a common
clock.
In Asynchronous communication we have to add start bit, stop bit and for checking we can
also add parity bit.
In our project we will be using Asynchronous communication.
In Asynchronous communication the transmitter shifts the parallel data onto the serial line
using its own clock while the receiver extracts the data using its own clock. It converts the
serial data back to the parallel form after stripping off the start, stop, and parity bits.
When transmitting a byte say letter ‘A’, the UART (serial port) first sends a START BIT which
is a positive voltage (0), followed by the data which in this case will be the ASCII of the letter
i.e. 01000001 (general 8 bits, but could be 5, 6, 7, or 8 bits) followed by one or two STOP
BITs which is a negative(1) voltage. The sequence is repeated for each byte sent.
5. MAX232 IC
The MAX232 IC is used to convert the TTL/CMOS logic levels to RS232 logic levels during
serial communication of microcontrollers with PC. The controller operates at TTL logic level
(0-5V) whereas the serial communication in PC works on RS232 standards (-25 V to + 25V).
This makes it difficult to establish a direct link between them to communicate with each
other.
The intermediate link is provided through MAX232. It is a dual driver/receiver that includes a
capacitive voltage generator to supply RS232 voltage levels from a single 5V supply. Each
receiver converts RS232 inputs to 5V TTL/CMOS levels. These receivers (R1 & R2) can accept
±30V inputs. The drivers (T1 & T2), also called transmitters, convert the TTL/CMOS input level
into RS232 level.
The transmitters take input from controller’s serial transmission pin and send the output to
RS232’s receiver. The receivers, on the other hand, take input from transmission pin of RS232
serial port and give serial output to microcontroller’s receiver pin. MAX232 needs four
external capacitors whose value ranges from 1µF to 22µF.
References:
http://www.taltech.com/datacollection/articles/serial_intro
http://retired.beyondlogic.org/serial/serial.htm