Anda di halaman 1dari 41

ZIGEBEE

ARVIND KUMAR

[Type text] Page 0


ZigBee is the set of specs built around the IEEE 802.15.4 wireless protocol. The IEEE is
the Institute of Electrical and Electronics Engineers, a non-profit organization dedicated to
furthering technology involving electronics and electronic devices. The 802 group is the section
of the IEEE involved in network operations and technologies, including mid-sized networks and
local networks. Group 15 deals specifically withwireless networking technologies, and includes
the now ubiquitous 802.15.1 working group, which is also known as Bluetooth®. The standard
itself is regulated by a group known as the ZigBee Alliance, with over 150 members worldwide.

While Bluetooth® focuses on connectivity between large packet user devices, such as
laptops, phones, and major peripherals,ZigBee is designed to provide highly efficient
connectivity between small packet devices. As a result of its simplified operations, which are one
to two full orders of magnitude less complex than a comparable Bluetooth® device, pricing for
ZigBee devices is extremely competitive, with full nodes available for a fraction of the cost of a
Bluetooth® node.

ZigBee devices are actively limited to a through-rate of 250 Kbps, compared to


Bluetooth®'s much larger pipeline of 1Mbps, operating on the 2.4 GHz ISM band, which is
available throughout most of the world.

ZigBee has been developed to meet the growing demand for capable wireless networking
between numerous low-power devices. In industry ZigBee is being used for next
generation automated manufacturing, with small transmitters in every device on the floor,
allowing for communication between devices to a central computer. This new level of
communication permits finely-tuned remote monitoring and manipulation. In the consumer
market ZigBee is being explored for everything from linking low-power household devices such
as smoke alarms to a central housing control unit, to centralized light controls.

The specified maximum range of operation for ZigBee devices is 250 feet (76m),
substantially further than that used by Bluetooth® capable devices, although security concerns
raised over "sniping" Bluetooth® devices remotely, may prove to hold true for ZigBee devices as
well.

1
Due to its low power output, ZigBee devices can sustain themselves on a small battery
for many months, or even years, making them ideal for install-and-forget purposes, such as most
small household systems. Predictions of ZigBee installation for the future, most based on the
explosive use of ZigBee in automated household tasks in China, look to a near future when
upwards of 60 ZigBee devices may be found in an average American home, all communicating
with one another freely and regulating common tasks seamlessly.

We’re beginning to hear more and more about this wireless technology called ZigBee. A
catchy name for sure, but what is it and who needs it? We already have Bluetooth- and Wi-Fi-
enabled devices, and WiMAX and Wireless USB proliferation are at the doorstep. Who needs
another wireless standard?

First, let’s understand that each wireless technology that makes it to market serves a
special purpose or function. Bluetooth and wireless USB provide short-range connectivity in
what is called a personal-area network (PAN). Bluetooth serves a short-range, moderate-speed,
wire replacer, and wireless USB provides short-range, high-speed device connectivity. Wi-Fi is
for local-area networks (LANs) and WiMAX is designed to provide wide-area networking
(WAN) or metropolitan-area networking (MAN).

ZigBee fills yet another nitch. It is a PAN technology based on the IEEE 802.15.4
standard. Unlike Bluetooth or wireless USB devices, ZigBee devices have the ability to form a
mesh network between nodes. Meshing is a type of daisy chaining from one device to another.
This technique allows the short range of an individual node to be expanded and multiplied,
covering a much larger area.

One ZigBee network can contain more than 65,000 nodes (active devices). The network
they form in cooperation with each other may take the shape of a star, a branching tree or a net
(mesh). What’s more, each device can operate for years off of a AA cell. That means that each
node uses little power.

What might be perceived as a disadvantage is the low data rate of ZigBee devices,
typically less than 100 kbps, depending on the selected frequency band. Is slow bad? That
depends on the function or service the technology is intended to provide. That brings us to the
opening question: Who needs ZigBee?
2
If you are looking for wireless monitoring and remote control solutions, ZigBee may be
the answer. Those are the functions for which ZigBee was designed. ZigBee nodes can be used
to tie an entire home, office or factory together for safety, security and control.

Nodes are embedded in hundreds of sensors and controls that are built into large
infrastructures for home automation, industrial automation, remote metering, automotives,
medical equipment, patient monitoring, asset tracking systems, security systems, lighting and
temperature control systems, and even toys.

There are three categories of ZigBee devices:

 ZigBee Network Coordinator. Smart node that automatically initiates the formation of the
network.

 ZigBee Router. Another smart node that links groups together and provides multi-hoping
for messages. It associates with other routers and end-devices.

 ZigBee End Devices. Where the rubber hits the road—sensors, actuators, monitors,
switches, dimmers and other controllers.

Electronic data communications between elements will generally fall into two broad
categories: single-ended and differential. RS232 (single-ended) was introduced in 1962, and
despite rumors for its early demise, has remained widely used through the industry.

Independent channels are established for two-way (full-duplex) communications. The RS232
signals are represented by voltage levels with respect to a system common (power / logic
ground). The "idle" state (MARK) has the signal level negative with respect to common, and the
"active" state (SPACE) has the signal level positive with respect to common. RS232 has
numerous handshaking lines (primarily used with modems), and also specifies a communications
protocol.

The RS-232 interface presupposes a common ground between the DTE and DCE. This is a
reasonable assumption when a short cable connects the DTE to the DCE, but with longer lines
and connections between devices that may be on different electrical busses with different
grounds, this may not be true.

3
RS232 data is bi-polar.... +3 TO +12 volts indicates an "ON or 0-state (SPACE) condition"
while A -3 to -12 volts indicates an "OFF" 1-state (MARK) condition.... Modern computer
equipment ignores the negative level and accepts a zero voltage level as the "OFF" state. In fact,
the "ON" state may be achieved with lesser positive potential. This means circuits powered by 5
VDC are capable of driving RS232 circuits directly, however, the overall range that the RS232
signal may be transmitted/received may be dramatically reduced.

The output signal level usually swings between +12V and -12V. The "dead area" between
+3v and -3v is designed to absorb line noise. In the various RS-232-like definitions this dead
area may vary. For instance, the definition for V.10 has a dead area from +0.3v to -0.3v. Many
receivers designed for RS-232 are sensitive to differentials of 1v or less.

This can cause  problems when using pin powered widgets - line drivers, converters, modems
etc. These type of units need enough voltage & current to power them self's up. Typical URART
(the RS-232 I/O chip) allows up to 50ma per output pin - so if the device needs 70ma to run we
would need to use at least 2 pins for power. Some devices are very efficient and only require one
pin (some times the Transmit or DTR pin) to be high - in the "SPACE" state while idle.

An RS-232 port can supply only limited power to another device. The number of output
lines, the type of interface driver IC, and the state of the output lines are important
considerations.

The types of driver ICs used in serial ports can be divided into three general categories:

 Drivers which require plus (+) and minus (-) voltage power supplies such as the 1488
series of interface integrated circuits. (Most desktop and tower PCs use this type of
driver.)

 Low power drivers which require one +5 volt power supply. This type of driver has an
internal charge pump for voltage conversion. (Many industrial microprocessor controls
use this type of driver.)

 Low voltage (3.3 v) and low power drivers which meet the EIA-562 Standard. (Used on
notebooks and laptops.)

4
Data is transmitted and received on pins 2 and 3 respectively. Data  Set Ready (DSR) is
an indication from the Data Set (i.e., the modem or DSU/CSU) that it is on. Similarly, DTR
indicates to the Data Set that the DTE is on. Data Carrier Detect (DCD) indicates that a good
carrier is being received from the remote modem.

Pins 4 RTS (Request To Send - from the transmitting computer) and 5 CTS (Clear To
Send - from the Data set) are used to control. In most Asynchronous situations, RTS and CTS are
constantly on throughout the communication session. However where the DTE is connected to a
multipoint line, RTS is used to turn carrier on the modem on and off. On a multipoint line, it's
imperative that only one station is transmitting at a time (because they share the return phone
pair). When a station wants to transmit, it raises RTS. The modem turns on carrier, typically
waits a few milliseconds for carrier to stabilize, and then raises CTS. The DTE transmits when it
sees CTS up. When the station has finished its transmission, it drops RTS and the modem drops
CTS and carrier together.

Clock signals (pins 15, 17, & 24) are only used for synchronous communications. The
modem or DSU extracts the clock from the data stream and provides a steady clock signal to the
DTE. Note that the transmit and receive clock signals do not have to be the same, or even at the
same baud rate.

Note: Transmit and receive leads (2 or 3) can be reversed depending on the use of the
equipment - DCE Data Communications Equipment or a DTE Data Terminal Equipment.

Glossary of Abbreviations etc.

CTS            Clear To Send [DCE --> DTE]


DCD           Data Carrier Detected (Tone from a modem) [DCE --> DTE]
DCE            Data Communications Equipment eg. modem
DSR            Data Set Ready [DCE --> DTE]
DSRS         Data Signal Rate Selector [DCE --> DTE] (Not commonly     
                    used)

5
DTE            Data Terminal Equipment eg. computer, printer
DTR            Data Terminal Ready [DTE --> DCE]
FG              Frame Ground (screen or chassis)
NC              No Connection
RCk            Receiver (external) Clock input
RI                Ring Indicator (ringing tone detected)
RTS            Request To Send [DTE --> DCE]
RxD            Received Data [DCE --> DTE]
SG              Signal Ground
SCTS         Secondary Clear To Send [DCE --> DTE]
SDCD        Secondary Data Carrier Detected (Tone from a modem)      
                    [DCE  --> DTE]
SRTS         Secondary Request To Send [DTE --> DCE]
SRxD         Secondary Received Data [DCE --> DTE]
STxD         Secondary Transmitted Data [DTE --> DCE]
TxD            Transmitted Data [DTE --> DCE]

Is Your Interface a DTE or a DCE?

One of the stickiest areas of confusion in datacom is over the terms "transmit" and
"receive" as they pertain to DTE (data terminal equipment) and DCE (data
communication equipment). In synchronous communication, this confusion is
particularly acute, because more signals are involved. So why is it that you sometimes
send data on TD, and other times you send data on RD? Is this just a cruel form of mental
torture? Not really. The secret lies in adopting the proper perspective. In data-com, the
proper perspective is always from the point of view of the DTE. When you sit at a PC,
terminal or workstation (DTE) and transmit data to somewhere far away, you naturally do
so on the TD (transmit data) line. When your modem or CSU/DSU (DCE) receives this
incoming data, it receives the data on the TD line as well. Why? Because the only
perspective that counts in data-com is the perspective of the DTE. It does not matter that

6
the DCE thinks it is receiving data; the line is still called "TD". Conversely, when the
modem or CSU/DSU receives data from the outside world and sends it to the DTE, it
sends it on the RD line. Why? Because from the perspective of the DTE, the data is being
received! So when wondering, "Is this line TD or RD? Is it TC or RC?" Ask yourself,
"What would the DTE say?"

Find out by following these steps: The point of reference for all signals is the terminal (or
PC).

1 ) Measure the DC voltages between (DB25) pins 2 & 7 and between pins 3 & 7. Be sure the
black lead is connected to pin 7 (Signal Ground) and the red lead to whichever pin you are
measuring.

2) If the voltage on pin 2 is more negative than -3 Volts, then it is a DTE, otherwise it should be
near zero volts.

3) If the voltage on pin 3  is more negative than -3 Volts, then it is a DCE.

4) If both pins 2 & 3 have a voltage of at least 3 volts, then either you are measuring incorrectly,
or your device is not a standard EIA-232 device. Call technical support.

5) In general, a DTE provides a voltage on TD, RTS, & DTR, whereas a DCE provides voltage
on RD, CTS, DSR, & CD.

7
X.21 interface on a DB 15 connector

 also see X.21 write up

also see end of page for more info

X.21

General
 

Voltages: +/- 0.3Vdc

Max. 100Kbps (X.26)


Speeds:
Max. 10Mbps (X.27)

he X.21 interface was recommended by the CCITT in 1976. It is defined as a digital


signaling interface between customers (DTE) equipment and carrier's equipment (DCE). And
thus primarily used for telecom equipment.

All signals are balanced. Meaning there is always a pair (+/-) for each signal, like used in
RS422. The X.21 signals are the same as RS422, so please refer to RS422 for the exact details.

Pinning according to ISO 4903

8
Sub-D15 Male Sub-D15 Female

Pin Signal abbr. DTE DCE

1 Shield   - -

2 Transmit (A)   Out In

3 Control (A)   Out In

4 Receive (A)   In Out

5 Indication (A)   In Out

6 Signal Timing (A)   In Out

7 Unassigned

8 Ground   - -

9 Transmit (B)   Out In

10 Control (B)   Out In

11 Receive (B)   In Out

12 Indication (B)   In Out

13 Signal Timing (B)   In Out

14 Unassigned

15 Unassigned

Functional Description
As can be seen from the pinning specifications, the Signal Element Timing (clock) is provided
by the DCE. This means that your provider (local telco office) is responsible for the correct

9
clocking and that X.21 is a synchronous interface. Hardware handshaking is done by the Control
and Indication lines. The Control is used by the DTE and the Indication is the DCE one.

Cross-cable pinning
  X.21 Cross Cable

X.21 X.21

1 1

2 4

3 5

4 2

5 3

6 7

7 6

8 8

9 11

10 12

11 9

12 10

13 14

14 13

15  

10
RS232D uses RJ45 type connectors 
(similar to telephone connectors) 

Pin No. Signal Description Abbr. DTE DCE

1 DCE Ready, Ring Indicator DSR/RI

2 Received Line Signal Detector DCD

3 DTE Ready DTR

4 Signal Ground SG

5 Received Data RxD

11
6 Transmitted Data TxD

7 Clear To Send CTS

8 Request To Send RTS

This is a standard 9 to 25 pin cable layout for async data on a PC AT serial cable
 

9-pin 25-pin
Description Signal Source DTE or DCE
DTE DCE

Carrier Detect CD 1 8 from Modem

Receive Data RD 2 3 from Modem

Transmit Data TD 3 2 from Terminal/Computer

Data Terminal Ready DTR 4 20 from   Terminal/Computer

Signal Ground SG 5 7 from Modem

Data Set Ready DSR 6 6 from Modem

Request to Send RTS 7 4 from   Terminal/Computer

Clear to Send CTS 8 5 from Modem

Ring Indicator RI 9 22 from Modem

This a DTE port as on the back of a PC Com Port -

EIA-574 RS-232/V.24 pin out on a DB-9 pin

used for Asynchronous Data

12
 

13
 25 pin D-shell connector RS232 
commonly used for Async. data

PIN SIGNAL  DESCRIPTION

1   PGND Protective Ground


2   TXD Transmit Data
3   RXD Receive Data
4   RTS RequestTo Send
5   CTS Clear To Send
6   DSR Data Set Ready

14
7   SG Signal Ground
8   CD Carrier Detect
20  DTR Data Terminal Ready
22  RI Ring Indicator
Some applications require more pins

than a simple async. configurations.

15
Pins used for Synchronous data

 jump to Other Connector pages

RS-232 Specs.

16
SPECIFICATIONS RS232 RS423

SINGLE SINGLE
Mode of Operation
-ENDED -ENDED

1 DRIVER 1 DRIVER
Total Number of Drivers and Receivers on One Line
1 RECVR 10 RECVR

Maximum Cable Length 50 FT. 4000 FT.

Maximum Data Rate 20kb/s 100kb/s

Maximum Driver Output Voltage +/-25V +/-6V

Driver Output Signal Level (Loaded Min.) Loaded +/-5V to +/-15V +/-3.6V

Driver Output Signal Level (Unloaded Max) Unloaded +/-25V +/-6V

Driver Load Impedance (Ohms) 3k to 7k >=450

Max. Driver Current in High Z State Power On N/A N/A

Max. Driver Current in High Z State Power Off +/-6mA @ +/-2v +/-100uA

Slew Rate (Max.) 30V/uS Adjustable

Receiver Input Voltage Range +/-15V +/-12V

Receiver Input Sensitivity +/-3V +/-200mV

Receiver Input Resistance (Ohms) 3k to 7k 4k min.

One byte of async data

17
Cabling considerations - you should use cabling made for RS-232 data but I have seen
low speed data go over 250' on 2 pair phone cable. Level 5 cable can also be used but for best
distance use a low capacitance data grade cable.

The standard maxim length is 50' but if data is async you can increase that distance to as
much as 500' with a good grade of cable. 

The RS-232 signal on a single cable is impossible to screen effectively for noise. By
screening the entire cable we can reduce the influence of outside noise, but internally generated
noise remains a problem. As the baud rate and line length increase, the effect of capacitance
between the different lines introduces serious crosstalk (this especially true on synchronous data
- because of the clock lines) until a point is reached where the data itself is unreadable. Signal
Crosstalk can be reduced by using low capacitance cable and shielding each pair

18
Using a high grade cable (individually shield low capacitance pairs) the distance can be
extended to 4000'

At higher frequencies a new problem comes to light. The high frequency component of
the data signal is lost as the cable gets longer resulting in a   rounded, rather than square wave
signal.

The maxim distance will depend on the speed and noise level around the cable run.

On longer runs a line driver is needed. This is a simple modem used to increase the maxim
distance you can run RS-232 data.

Making sense of the specifications

Selecting data cable isn't difficult, but often gets lost in the shuffle of larger system issues. Care
should be taken. however, because intermittent problems caused by marginal cable can be very
difficult to troubleshoot.

Beyond the obvious traits such as number of conductors and wire gauge, cable specifications
include a handful of less intuitive terms.

Characteristic Impedance (Ohms): A value based on the inherent conductance, resistance,


capacitance and inductance of a cable that represents the impedance of an infinitely long cable.
When the cable is out to any length and terminated with this Characteristic Impedance,
measurements of the cable will be identical to values obtained from the infinite length cable.
That is to say that the termination of the cable with this impedance gives the cable the
appearance of being infinite length, allowing no reflections of the transmitted signal. If
termination is required in a system, the termination impedance value should match the
Characteristic Impedance of the cable.

Shunt Capacitance (pF/ft): The amount of equivalent capacitive load of the cable, typically listed
in a per foot basis One of the factors limiting total cable length is the capacitive load. Systems
with long lengths benefits from using low capacitance cable.

19
Propagation velocity (% of c): The speed at which an electrical signal travels in the cable. The
value given typically must be multiplied by the speed of light (c) to obtain units of meters per
second. For example, a cable that lists a propagation velocity of 78% gives a velocity of 0.78 X
300 X 106 - 234 X 106 meters per second.

Plenum cable

Plenum rated cable is fire resistant and less toxic when burning than non-plenum rated cable.
Check building and fire codes for requirements. Plenum cable is generally more expensive due to
the sheathing material used.

The  specification recommends 24AWG twisted pair cable with a shunt capacitance of 16 pF per
foot and 100 ohm characteristic impedance. 

It can be difficult to qualify whether shielding is required in a particular system or not, until
problems arise. We recommend erring on the safe side and using shielded cable. Shielded cable
is only slightly more expensive than unshielded.

There are many cables available meeting the recommendations of RS-422 and RS-485, made
specifically for that application. Another choice is the same cable commonly used in the Twisted
pair Ethernet cabling. This cable, commonly referred to as Category 5 cable, is defined by the
ElA/TIA/ANSI 568 specification The extremely high volume of Category 5 cable used makes it
widely available and very inexpensive, often less than half the price of specialty RS422/485
cabling. The cable has a maximum capacitance of 17 pF/ft (14.5 pF typical) and characteristic
impedance of 100 ohms.

Category 5 cable is available as shielded twisted pair (STP) as well as unshielded twisted pair
(UTP) and generally exceeds the recommendations  making it an excellent choice for RS232
systems.

20
RS232 - V.24/V.28 - IS2110 - X.20 bis (for Async) - 
X.21 bis (for Sync)

General

In this document the term RS232 will be used when refered to this serial interface. The
description of RS232 is an EIA/TIA norm and is identical to CCITT V.24/V.28, X.20bis/X.21bis
and ISO IS2110. The only difference is that CCITT has split the interface into its electrical
description (V.28) and a mechanical part (V.24) or Asynchronous (X.20 bis) and Synchronous
(X.21 bis) where the EIA/TIA describes everything under RS232.

As said before RS232 is a serial interface. It can be found in many different applications where
the most common ones are modems and Personal Computers. All pinning specifications are
writen for the DTE side.

All DTE-DCE cables are straight through meaning the pins are connected one on one. DTE-DTE
and DCE-DCE cables are cross cables. To make a destiction between all different types of cables
we have to use a naming convention.
DTE - DCE: Straight Cable
DTE - DTE: Null-Modem Cable
DCE - DCE: Tail Circuit Cable

Interface Mechanical

RS232 can be found on different connectors. There are special specifications for this. The
CCITT only defines a Sub-D 25 pins version where the EIA/TIA has two versions RS232C and
RS232D which are resp. on a Sub-D25 and a RJ45. Next to this IBM has added a Sub-D 9
version which is found an almost all Personal Computers and is described in TIA 457.

21
Male Female

Pinnings

Circuit Circuit
RS232-C Description RJ45 TIA 457
EIA CCITT

1 Shield Ground AA      

7 Signal Ground AB 102 4 5

2 Transmitted Data BA 103 6 3

3 Received Data BB 104 5 2

4 Request To Send CA 105 8 7

5 Clear To Send CB 106 7 8

6 DCE Ready CC 107 1 6

20 DTE Ready CD 108.2 3 4

22 Ring Indicator CE 125 1 9

8 Received Line Signal Detector CF 109 2 1

Data Signal Rate Select


23 CH/CI 111/112    
(DTE/DCE Source>

Transmit Signal Element Timing


24 DA 113    
(DTE Source)

Transmitter Signal Element Timing


15 DB 114    
(DCE Source)

17 Receiver Signal Element Timing DD 115    

22
(DCE Source)

18 Local Loopback / Quality Detector LL 141    

21 Remote Loopback RL/CG 140/110    

14 Secondary Transmitted Data SBA 118    

16 Secondary Received Data SBB 119    

19 Secondary Request To Send SCA 120    

13 Secondary Clear To Send SCB 121    

Secondary Received Line Signal Detector/


12 SCF/CI 122/112    
Data signal Rate Select (DCE Source)

25 Test Mode TM 142    

9 Reserved for Testing        

10 Reserved for Testing        

11 Unassigned        

23
Interface Electrical

All signals are measured in reference to a common ground, which is called the signal
ground (AB). A positive voltage between 3 and 15 Vdc represents a logical 0 and a negative
voltage between 3 and 15 Vdc represents a logical 1.

This switching between positive and negative is called bipolar. The zero state is not
defined in RS232 and is considered a fault condition (this happens when a device is turned off).
According to the above a maximum distance of 50 ft or 15 m. can be reached at a maximum
speed of 20k bps. This is according to the official specifications, the distance can be exceeded
with the use of Line Drivers.

Functional description

Description Circuit Function

Also known as protective ground. This is the chassis ground


Shield Ground AA
connection between DTE and DCE.

The reference ground between a DTE and a DCE. Has the value 0
Signal Ground AB
Vdc.

Transmitted Data BA Data send by the DTE.

Received Data BB Data received by the DTE.

Request To Send CA Originated by the DTE to initiate transmission by the DCE.

Send by the DCE as a reply on the RTS after a delay in ms, which
Clear To Send CB gives the DCEs enough time to energize their circuits and
synchronize on basic modulation patterns.

Known as DSR. Originated by the DCE indicating that it is


DCE Ready CC
basically operating (power on, and in functional mode).

Known as DTR. Originated by the DTE to instruct the DCE to setup


DTE Ready CD a connection. Actually it means that the DTE is up and running and
ready to communicate.

24
A signal from the DCE to the DTE that there is an incomming call
Ring Indicator CE
(telephone is ringing). Only used on switched circuit connections.

Received Line Known as DCD. A signal send from DCE to its DTE to indicate that
CF
Signal Detector it has received a basic carrier signal from a (remote) DCE.

Data Signal Rate


Select CH/CI A control signal that can be used to change the transmission speed.
(DTE/DCE Source>

Transmit Signal
Timing signals used by the DTE for transmission, where the clock
Element Timing DA
is originated by the DTE and the DCE is the slave.
(DTE Source)

Transmitter Signal
Element Timing DB Timing signals used by the DTE for transmission.
(DCE Source)

Receiver Signal
Element Timing DD Timing signals used by the DTE when receiving data.
(DCE Source)

Local Loopback /
LL  
Quality Detector

Originated by the DCE that changes state when the analog signal
Remote Loopback RL/CG
received from the (remote) DCE becomes marginal.

Test Mode TM  

Reserved for
   
Testing

The secondary signals are used on some DCE's. Those units have the possibility to
transmit and/or receive on a secondary channel. Those secondary channels are mostly of a lower
speed than the normal ones and are mainly used for administrative functions.

25
Cable pinning
Here are some cable pinning that might be useful. Not all applications are covered, it is just a
help:

26
Straight DB25 DB25 Null- modem  DB25 Tail- circuit  DB25 to DB9 DTE - DCE
Cable or cross over cable or cross over cable cable cable
(Async) (Sync)

Pi Pi Pi Pi Pi Pi Pi Pi  
n n n n n n n n

1 1 1 1 1 1   1

2 2 2 3 2 3 3 2

3 3 3 2 3 2 2 3

4 4 4 5 4 8 7 4

5 5 5 4 6 20 8 5

6 6 6, 7 7 6 6
20
8
7 7 8 4 5 7
7 7
8 8 17 24 1 8
6,
9 9 20 20 6 4 20
8
10 10 24 17 9 22
</
11 11    
DB9 Null-
12 12
modem or 
13 13 cross over

14 14 cable

15 15 1,
4
6
16 16
2 3
17 17
3 2
18 18
1,
19 19 4
6
20 20
5 5
21 21
7 8
22 22
8 7
23 23
27
24 24

25 25
This cable should be used for DTE to DCE (for instance computer to modem) connections with
hardware handshaking.

 (To Computer).

 (To Modem).

9 PIN D-SUB FEMALE to the Computer


25 PIN D-SUB MALE to the Modem

  Female Male Dir

Shield   1  

Transmit Data 3 2

Receive Data 2 3

Request to Send 7 4

Clear to Send 8 5

Data Set Ready 6 6

System Ground 5 7  

Carrier Detect 1 8

Data Terminal Ready 4 20

Ring Indicator 9 22

Nullmodem (25-25) Cable

Use this cable between two DTE devices (for instance two computers).

28
 (To Computer 1).

 (To Computer 2).

25 PIN D-SUB FEMALE to Computer 1.


25 PIN D-SUB FEMALE to Computer 2.

  D-Sub 1 D-Sub 2  

Recieve Data 3 2 Transmit Data

Transmit Data 2 3 Receive Data

Data Terminal Ready 20 6+8 Data Set Ready + Carrier Detect

System Ground 7 7 System Ground

Data Set Ready + Carrier Detect 6+8 20 Data Terminal Ready

Request to Send 4 5 Clear to Send

Clear to Send 5 4 Request to Send

Note: DSR & CD are jumpered to fool the programs to think that their online.

RS232 (25 pin) Tail Circuit Cable

29
Null Modem cable diagrams

 Nullmodem (9p to 9p)

 Nullmodem (9p to 25p)

 Nullmodem (25p to 25p)

Cross Pinned cables for Async data.

Pin out for local Async Data transfer

Loopb

30
Serial Programming/MAX232 Driver Receiver

< Serial Programming

Serial Programming: Introduction and OSI Network Model -- RS-232 Wiring and


Connections -- Typical RS232 Hardware Configuration -- 8250 UART -- DOS -- MAX232
Driver/Receiver Family -- TAPI Communications In Windows -- Linux and
Unix -- Java -- Hayes-compatible Modems and AT Commands -- Universal Serial Bus
(USB) -- Forming Data Packets -- Error Correction Methods -- Two Way
Communication -- Packet Recovery Methods -- Serial Data Networks -- Practical Application
Development -- IP Over Serial Connections

MAX232 Driver/Receiver

Applicability

This module is primary of interest for people building their own electronics with an RS-
232 interface. Off-the-shelf computers with RS-232 interfaces already contain the necessary
electronics, and there is no need to add the circuitry as described here.

Introduction

Logic Signal Voltage

Serial RS-232 (V.24) communication works with voltages (between -15V ... -3V are used
to transmit a binary '1' and +3V ... +15V to transmit a binary '0') which are not compatible with
today's computer logic voltages. On the other hand, classic TTL computer logic operates
between 0V ... +5V (roughly 0V ... +0.8V referred to as low for binary '0', +2V ... +5V

31
for high binary '1' ). Modern low-power logic operates in the range of 0V ... +3.3V or even
lower.

So, the maximum RS-232 signal levels are far too high for today's computer logic
electronics, and the negative RS-232 voltage can't be grokked at all by the computer logic.
Therefore, to receive serial data from an RS-232 interface the voltage has to be reduced, and
the 0 and 1 voltage levels inverted. In the other direction (sending data from some logic over RS-
232) the low logic voltage has to be "bumped up", and a negative voltage has to be generated,
too.

RS-232 TTL Logic

-----------------------------------------------

-15V ... -3V <-> +2V ... +5V <-> 1

+3V ... +15V <-> 0V ... +0.8V <-> 0

All this can be done with conventional analog electronics, e.g. a particular power supply
and a couple of transistors or the once popular 1488 (transmitter) and 1489 (receiver) ICs.
However, since more than a decade it has become standard in amateur electronics to do the
necessary signal level conversion with an integrated circuit (IC) from the MAX232 family
(typically a MAX232A or some clone). In fact, it is hard to find some RS-232 circuitry in
amateur electronics without a MAX232A or some clone.

The MAX232 & MAX232A

A MAX232 integrated circuit

32
The MAX232 from Maxim was the first IC which in one package contains the necessary
drivers (two) and receivers (also two), to adapt the RS-232 signal voltage levels to TTL logic. It
became popular, because it just needs one voltage (+5V) and generates the necessary RS-232
voltage levels (approx. -10V and +10V) internally. This greatly simplified the design of circuitry.
Circuitry designers no longer need to design and build a power supply with three voltages (e.g.
-12V, +5V, and +12V), but could just provide one +5V power supply, e.g. with the help of a
simple 78x05 voltage converter.

The MAX232 has a successor, the MAX232A. The ICs are almost identical, however, the
MAX232A is much more often used (and easier to get) than the original MAX232, and the
MAX232A only needs external capacitors 1/10th the capacity of what the original MAX232
needs.

It should be noted that the MAX232(A) is just a driver/receiver. It does not generate the
necessary RS-232 sequence of marks and spaces with the right timing, it does not decode the RS-
232 signal, it does not provide a serial/parallel conversion. All it does is to convert signal voltage
levels. Generating serial data with the right timing and decoding serial data has to be done by
additional circuitry, e.g. by a 16550 UART or one of these small micro controllers (e.g. Atmel
AVR, Microchip PIC) getting more and more popular.

The MAX232 and MAX232A were once rather expensive ICs, but today they are cheap.
It has also helped that many companies now produce clones (ie. Sipex). These clones sometimes
need different external circuitry, e.g. the capacities of the external capacitors vary. It is
recommended to check the data sheet of the particular manufacturer of an IC instead of relying
on Maxim's original data sheet.

The original manufacturer (and now some clone manufacturers, too) offers a large series
of similar ICs, with different numbers of receivers and drivers, voltages, built-in or external
capacitors, etc. E.g. The MAX232 and MAX232A need external capacitors for the internal
voltage pump, while the MAX233 has these capacitors built-in. The MAX233 is also between
three and ten times more expensive in electronic shops than the MAX232A because of its
internal capacitors. It is also more difficult to get the MAX233 than the garden variety
MAX232A.

33
A similar IC, the MAX3232 is nowadays available for low-power 3V logic.

MAX232(A) DIP Package

+---v---+

C1+ -|1 16|- Vcc

V+ -|2 15|- GND

C1- -|3 14|- T1out

C2+ -|4 13|- R1in

C2- -|5 12|- R1out

V- -|6 11|- T1in

T2out -|7 10|- T2in

R2in -|8 9|- R2out

+-------+

MAX232(A) DIP Package Pin Layout

Capacitor Value Capacitor Value


Nbr Name Purpose Signal Voltage
MAX232 MAX232A

+ connector for capacitor should stand


1 C1+ 1µF 100nF
capacitor C1 at least 16V

+10V, capacitor
output of voltage
2 V+ should stand at least 1µF to VCC 100nF to VCC
pump
16V

3 C1- - connector for capacitor should stand 1µF 100nF

34
capacitor C1 at least 16V

+ connector for capacitor should stand


4 C2+ 1µF 100nF
capacitor C2 at least 16V

- connector for capacitor should stand


5 C2- 1µF 100nF
capacitor C2 at least 16V

output of voltage -10V, capacitor should


6 V- 1µF to GND 100nF to GND
pump / inverter stand at least 16V

7 T2out Driver 2 output RS-232

8 R2in Receiver 2 input RS-232

9 R2out Receiver 2 output TTL

10 T2in Driver 2 input TTL

11 T1in Driver 1 input TTL

12 R1out Receiver 1 output TTL

13 R1in Receiver 1 input RS-232

14 T1out Driver 1 output RS-232

15 GND Ground 0V 1µF to VCC 100nF to VCC

16 VCC Power supply +5V see above see above

V+(2) is also connected to VCC via a capacitor (C3). V-(6) is connected to GND via a
capacitor (C4). And GND(15) and VCC(16) are also connected by a capacitor (C5), as close as
possible to the pins.

A Typical Application

35
The MAX232(A) has two receivers (converts from RS-232 to TTL voltage levels) and
two drivers (converts from TTL logic to RS-232 voltage levels). This means only two of the RS-
232 signals can be converted in each direction. The old MC1488/1498 combo provided four
drivers and receivers.

Typically a pair of a driver/receiver of the MAX232 is used for

 TX and RX

and the second one for

 CTS and RTS.

There are not enough drivers/receivers in the MAX232 to also connect the DTR, DSR, and
DCD signals. Usually these signals can be omitted when e.g. communicating with a PC's serial
interface. If the DTE really requires these signals either a second MAX232 is needed, or some
other IC from the MAX232 family can be used (if it can be found in consumer electronic shops
at all). An alternative for DTR/DSR is also given below.

Maxim's data sheet explains the MAX232 family in great detail, including the pin
configuration and how to connect such an IC to external circuitry. This information can be used
as-is in own design to get a working RS-232 interface. Maxim's data just misses one critical
piece of information: How exactly to connect the RS-232 signals to the IC. So here is one
possible example:

MAX232 to RS232 DB9 Connection as a DCE

MAX232 Pin Nbr. MAX232 Pin Name Signal Voltage DB9 Pin

7 T2out RTS RS-232 8

8 R2in CTS RS-232 7

9 R2out CTS TTL n/a

10 T2in RTS TTL n/a

36
11 T1in TX TTL n/a

12 R1out RX TTL n/a

13 R1in TX RS-232 3

14 T1out RX RS-232 2

15 GND GND 0 5

In addition one can directly wire DTR (DB9 pin 4) to DSR (DB9 pin 6) without going
through any circuitry. This gives automatic (brain dead) DSR acknowledgment of an
incoming DTR signal.

Sometimes pin 6 of the MAX232 is hard wired to DCD (DB9 pin 1). This is not
recommended. Pin 6 is the raw output of the voltage pump and inverter for the -10V voltage.
Drawing currents from the pin leads to a rapid breakdown of the voltage, and as a consequence
to a breakdown of the output voltage of the two RS-232 drivers. It is better to use software which
doesn't care about DCD, but does hardware-handshaking via CTS/RTS only.

The circuitry is completed by connecting five capacitors to the IC as it follows. The


MAX232 needs 1.0µF capacitors, the MAX232A needs 0.1µF capacitors. MAX232 clones show
similar differences. It is recommended to consult the corresponding data sheet. At least 16V
capacitor types should be used. If electrolytic or tantalic capacitors are used, the polarity has to
be observed. The first pin as listed in the following table is always where the plus pole of the
capacitor should be connected to.

MAX232(A) external Capacitors

Capacitor + Pin - Pin Remark

C1 1 3

C2 4 5

37
C3 2 16

This looks non-intuitive, but because pin 6 is


C4 GND 6
on -10V, GND gets the + connector, and not the -

C5 16 GND

The 5V power supply is connected to

 +5V: Pin 16

 GND: Pin 15

Alternatives

Data Cables

With the rise of mobile phones so called data cables for these phones have also become
popular. These are cables to connect the mobile phone to a serial interface of a computer [1]. The
interesting thing is that modern mobile phones work with 3.3V logic, and older phones with 5V
logic on their data buses. So these data cables must and do convert the phone logic voltage levels
to and from RS232 voltage levels.

No-name data cables have become rather cheap (as opposite to original phone-brand data
cables). The cheap cables with their voltage converters can be used as an alternative to home-
made MAX232-based circuitry. The advantage is that the cables occupy much less space (the
converter is usually inside the RS232 plug). Such a cable also saves the effort to solder a
circuitry board. Another advantage, which can also be a disadvantage of such a data cable is that
they usually take their power from the RS232 connector. This saves an external power supply,
but can also cause problems, because the RS232 interface is not designed to power some logic
and the DTE might not provide enough power[2]. Another disadvantage is that many of these
cables just support RX and TX (one receiver, one driver), and not two drivers/receivers as the
MAX232. So there is no hardware handshake possible. Finally, when using such a cable it
should be made sure that they convert to the desired voltage (3.3V or 5V).

38
1. ^ There are also data cables for USB ports, but these are of no interest here.

2. ^ Some data cables are powered by the phone and not via the RS232 interface. In such a
case an external power supply is still needed, to replace the one from the phone.

Ab)using a USB <-> RS-232 Converter

USB to Serial interface cables often have two components: a USB transciever that
outputs serial data; and a voltage shifter to produce standards-compliant RS-232 voltages. It is
often possible to throw away (ignore, desolder, cut-out) the USB part of these cables, connect an
external 5V power source (or abuse the RS-232 interface) to replace the power coming from the
USB bus and to just use the RS-232 level-shifter. All this is probably as much work as using a
MAX232A, although you get one RS-232 connector for free.

If you consider a USB cable, it is also worthwhile to consider using USB directly, instead
of RS-232. Many USB transceiver chips can be integrated directly into circuits, eliminating the
need for voltage-shifting components. Parts such as the FTDI FT232BM even have an input
allowing designers to select 5V or 3.3V output levels. Most of these USB transceiver chips are
available as surface-mount components only. But some vendors offer DIP-sized preassembled
modules, often at competitive prices, and often with free or cheap drivers or driver development
environments.

MAX232N

A Texas Instruments MAX232 (not A) second-source. The N indicates the package


(plastic dip), and not any special electric characteristics. This is a non-A MAX232,
therefore it needs at least 1µF capacitors. In can sometimes be found rather cheap. TI also
offers MAX3232s and a number of other RS-232 drivers/receivers, like MC148x.

39
Linear Technology LT1181A

The LT1181A from Linear Technology is very similar to the MAX232A. It has the exact
same pin-layout, also uses 0.1µF capacitors, and can in general replace a MAX232A. However,
for the hobbyist it is typically a little bit more difficult to get one, and they tend to be slightly
more expensive than the original Maxim MAX232A.

Intersil HIN202

The Intersil HIN202 is yet another IC very similar to the MAX232A. It also has the same
pin-layout (DIL package), uses 0.1 µF capacitors and can replace a MAX232A. The HIN202 is
especially interesting when more I/O lines are needed (four pairs), since the manufacturer
specifies that two HIN202's can share a single V+ and a single V- capacitor. So the resulting
circuit saves two capacitors.

MC148x

The MC1488/MC1489 ICs have already been mentioned. However, they are no real
alternative to a MAX232 these days. A combo of these ICs has twice as many drivers/receivers,
but the MC1488 driver requires a +12V, -12V power supply, and the MC1489 receiver a +5V
power supply. That makes three power supplies instead of one for the MAX232. It is
recommended to either use several MAX232s, or another IC from the MAX family if more
drivers/receivers are needed, like the MAX238.

40

Anda mungkin juga menyukai