Professional Documents
Culture Documents
Chapter 3
Chapter 3
RS232 monitoring hardware establishes a connection between data terminal equipment (DTE) and
data communication equipment (DCE).
In order to link these devices, an RS232 D9 pinout is essential, as this pinout will allow you to
connect two devices successfully.
OR
Need of RS232:
A line driver such as the MAX232 chip is required to convert RS232 voltage levels to TTL
levels, and vice versa.
8051 has two pins that are used specifically for transferring and receiving data serially.
These two pins are called TxD and RxD and are part of the port 3 group (P3.0 and P3.1).
These pins are TTL compatible; therefore, they require a line driver to make them RS232
compatible.
We need a line driver (voltage converter) to convert the R232’s signals to TTL voltage levels
that will be acceptable to 8051’s TxD and RxD pins.
Serial Communication Protocol:-
Controlled Area Network [CAN]:- Can is mainly used in automotive electronics. CAN bus is a
standard bus in distributed network. It has a bi-directional serial line which receives or sends a bit at
an instance by operating at maximum rate of 1Mbps. It employs a twisted pair connection to each
node. The pair can run to a maximum length of 40m.
CAN Frame -- an entire CAN transmission: arbitration ID, data bytes, acknowledge bit, and so
on. Frames also are referred to as messages. .
SOF (start-of-frame) bit – indicates the beginning of a message with a dominant (logic 0) bit.
Arbitration ID – identifies the message and indicates the message's priority. Frames come in
two formats -- standard, which uses an 11-bit arbitration ID, and extended, which uses a 29-
bit arbitration ID.
IDE (identifier extension) bit – allows differentiation between standard and extended
frames.
RTR (remote transmission request) bit – serves to differentiate a remote frame from a data
frame. A dominant (logic 0) RTR bit indicates a data frame. A recessive (logic 1) RTR bit
indicates a remote frame.
DLC (data length code) –
– contains 0 to 8 bytes of data.
CRC (cyclic redundancy check) – contains 15-bit cyclic redundancy check code and a
recessive delimiter bit. The CRC field is used for error detection.
ACK (Acknowledgement) slot – any CAN controller that correctly receives the message
sends an ACK bit at the end of the message. The transmitting node checks for the presence
of the ACK bit on the bus and reattempts transmission if no acknowledge is detected.
National Instruments Series 2 CAN interfaces have the capability of listen-only mode. Herein,
the transmission of an ACK bit by the monitoring hardware is suppressed to prevent it from
affecting the behavior of the bus.
CAN Signal – an individual piece of data contained within the CAN frame data field. You also
can refer to CAN signals as channels. Because the data field can contain up to 8 bytes of
data, a single CAN frame can contain 0 to 64 individual signals (for 64 channels, they would
all be binary)
(EOF) END OF FRAME– Each DATA FRAME and REMOTE FRAME is delimited by a flag
sequence consisting of ’recessive’ bits
I²C (Inter – Integrated Communication)Bus: In any process plant there are n numbers of device
circuits that are used for measurement of temperature, pressure and it is required to connect these
ICs through a common bus. For this I²C has become a standard.
The I²C bus has two lines that carry its signals. One line is for the clock and another is for the bi-
directional data. Serial data line [SDA] and Serial Clock [SCL]. The voltages used are +5 V and +3.3 V.
There is a protocol for the I²C bus.
Advantages:
4. Ease to implement.
Dis-Advantages:
1. Short distance.
2. Slow speed.
Applications of I²C Bus: I²C Bus is used for peripherals where simplicity and low manufacturing cost
are more important than speed.
5. Changing sound volume in intelligent speakers. Controlling OLED/OLCD displays in cell phones
Comparision between CAN and I2C protocols on the basis of following points:
USB protocol:-
Universal Serial Bus protocol:- Any computer that you buy today comes with one or more Universal
Serial Bus connectors. These USB connectors let you attach mice, printers and other accessories to
your computer quickly and easily.
The operating system supports USB as well, so the installation of the device drivers is quick and easy,
too. Compared to other ways of connecting devices to your computer (including parallel ports, serial
ports and special cards that you install inside the computer's case), USB devices are incredibly
simple.
The USB is based on a so-called tiered star topology in which there is a single host and up to
127 slave devices.
The host controller is connected to a hub within the PC which allows a number of
attachment points (ports).
A further hub can be plugged into each of these attachments and so on. However, there are
limitations on this expansion.
A maximum of 127 devices may be connected. This is because the address field in a packet is
7 bits long and the address 0 cannot be used as it has special significance.
A device can be plugged into a hub and that hub can be plugged into another hub and so on.
However, the maximum number of tieres permitted is six.
The length of any cable is limited to 5 meters. So, USB is intended as a bus for devices near
to PC. For applications requiring distance from the PC, another form of connection is needed
such as Ethernet.
Host is the master. So, all communications are initiated by the host. There can be no
communication directly between USB devices.
Features of USB:-
In SPI protocol, the devices are connected in a Master – Slave relationship in a multi – point
interface. In this type of interface, one device is considered the Master of the bus (usually a
Microcontroller) and all the other devices (peripheral ICs or even other Microcontrollers) are
considered as slaves.
Master – Out / Slave – In or MOSI, as the name suggests, is the data generated by the Master
and received by the Slave. Hence, MOSI pins on both the master and slave are connected
together.
MISO – MISO pins on both the master and slave are ties together. Even though the Signal in
MISO is produced by the Slave, the line is controlled by the Master.
SCK – The Master generates a clock signal at SCK and is supplied to the clock input of the slave.
(CS) or (SS) – Chip Select (CS) or Slave Select (SS) is used to select a particular slave by the
master.
Applications of SPI
Advantages
SPI is very simple to implement and the hardware requirements are not that complex.
Supports full – duplex communication at all times.
Very high speed of data transfer.
No need for individual addresses for slaves as CS or SS is used.
Only one master device is supported and hence there is no chance of conflicts.
Clock from the master is configured based on speed of the slave and hence slave doesn’t have
to worry about clock.
Disadvantages
Each additional slave requires an additional dedicated pin on master for CS or SS.
There is no acknowledgement mechanism and hence there is no confirmation of receipt of
data.
Slowest device determines the speed of transfer.
There are no official standards and hence often used in application specific implementations.
There is no flow control.
Features of Zigbee:
Features of IrDA: InfraRed (IrDA) is a serial half duplex, line of sight based wireless technology for
data communications between devices.
The remote control of TV, VCD players etc. works on the infrared data communication
principle.
Infrared communication technique uses infrared waves of the electromagnetic spectrum for
transmitting the data.
IrDA supports point-to-point and point-to-multipoint communication provided that all the
devices involved in the communication are within the line of sight.
The typical communication range for IrDA lies in the range 10 cm to 1 m. The range can be
increased by increasing the transmitting power of the IR device.
IR supports data rates ranging from 9600 bits/second to 16 Mbp
IR (SIR), Medium IR (MIR), Fast IR (FIR) depending on the speed of data transmission.
Parallel protocols PCI & PCI-X:-
PCI -X :
PCI-X is a computer bus and expansion card standard that enhances the 32-bit PCI local bus
for higher bandwidth transmission.
It was originally created by IBM, HP and Compaq in the year 1998.
It is a double wide version of PCL, running at up to four times the clock speed but is
otherwise similar in electrical implementation and uses the same protocol.
It has been replaced by the similar PCI Express bus, with a completely different connector
and a very different logical design.
It provides number of slower connections in parallel but the new version PCI-Express gives
single, narrow but fast serial connection.
Clock speed of PCI-X is doubled from 66 MHz to 133 MHz.
Maximum possible bandwidth is 1064M Bits/sec.
Split transactions increase the efficiency.
IEEE 802.11:-