100% found this document useful (2 votes)
175 views18 pages

Rs 232

The document discusses RS-232 and how it is used to connect serial devices. It describes the pinouts of RS-232 connectors and different logic levels like TTL, LVTTL and RS-232. It then explains how to convert between TTL and RS-232 logic levels using ICs like MAX232.

Uploaded by

vijay b
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
175 views18 pages

Rs 232

The document discusses RS-232 and how it is used to connect serial devices. It describes the pinouts of RS-232 connectors and different logic levels like TTL, LVTTL and RS-232. It then explains how to convert between TTL and RS-232 logic levels using ICs like MAX232.

Uploaded by

vijay b
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

RS-232 Basics

RS-232 (Recommended Standard – 232) is a standard interface approved by the


Electronic Industries Association (EIA) for connecting serial devices. In other words,
RS-232 is a long established standard that describes the physical interface and
protocol for relatively low-speed serial data communication between computers and
related devices. RS-232 is the interface that your computer uses to “talk” to and
exchange data with your modem and other serial devices. The serial ports on most
computers use a subset of the RS-232C standard. RS-232 protocol is mostly used
over the DB9 port (commonly known as serial port), however earlier it was used over
the DB25 port (also known as parallel port). We will have a look at both of them here.
RS-232 over DB-9
The pin configuration of DB-9 port is as follows. Yes, it looks exactly like (in fact it is)
the serial port you would find in older computers.

RS232 DB9 Connector


DB9 Connector Pins

The pin description for the RS-232 pins is as follows:


 DTR (data terminal ready): When terminal is turned on, it sends out signal
DTR to indicate that it is ready for communication.
 DSR (data set ready): When DCE is turned on and has gone through the self-
test, it assert DSR to indicate that it is ready to communicate.
 RTS (request to send): When the DTE device has byte to transmit, it assert
RTS to signal the modem that it has a byte of data to transmit.
 CTS (clear to send): When the modem has room for storing the data it is to
receive, it sends out signal CTS to DTE to indicate that it can receive the data now.
 DCD (data carrier detect): The modem asserts signal DCD to inform the DTE
that a valid carrier has been detected and that contact between it and the other
modem is established.
 RI (ring indicator): An output from the modem and an input to a PC indicates
that the telephone is ringing. It goes on and off in synchronous with the ringing
sound.
 RxD (Received data): The RxD pin is the Data Receive pin. This is the pin
where the receiver receives data.
 TxD (Transmitted data): The TxD pin is the Data Transmit pin. This is the pin
through which data is transmitted to the receiver.
 GND: Ground pin.

Logic Level Families


By ‘Logic Level’ one means the range of voltage over which a high bit (1) and a low
bit (0) is accepted in a particular IC, gate, etc. Various logic levels have been
standardized, out of which the most popular ones are:
1. TTL
TTL stands for Transistor-Transistor Logic. These days TTL is the most widely used
logic. TTL is mostly used in ICs and gates, like 74xx logic gates. A major drawback
of the TTL logic is that most of the devices working on the TTL Logic consume a lot
of current, even individual gates may draw up to 3-4 mA. In TTL Logic, a HIGH (or 1)
is +5 volts, whereas a LOW (or 0) is 0 volts.  But since attaining exact +5 volts and 0
volt is practically not possible every time, various IC manufactures define TTL logic
level range differently, but the usual accepted range for a HIGH is within +3.5 ~ +5.0
volts, and the range for a LOW is 0 ~ +0.8 volts.
2. LVTTL
LVTTL stands for Low Voltage Transistor-Transistor Logic. LVTTL is increasingly
becoming popular these days, because of the nominal HIGH voltages, and hence
lesser power consumption. By lowering the power supply from 5v to 3.3v, switching
power reduces by almost 60%! There are several transistors and gates, which work
on LVTTL logic. Atmel’s Atmega microcontrollers are designed to work on both,
LVTTL and TTL, depending upon the VCC supplied to the IC. In LVTTL Logic, a LOW
is defined for voltages 0V ~ 1.2V, and High for voltages 2.2V ~ 3.3V, making
1.2V~2.2V undefined.
3. RS-232
RS232 is also one of the most popular logic. Though now quite old, it is still in use. In
RS-232 logic, a HIGH (1) is represented within -3V ~ -25 V, whereas a LOW (0) is in
between +3V ~ +25 V, making -3V to +3V undefined. Weird isn’t it? ;) But that’s how
it is defined! Apart from these, there are many other logic families like ECL, RTL,
CMOS, LVCMOS, etc. At present, we are not much concerned about them. You can
refer to this article to know more about them.
Level Conversion – TTL/RS232
So what is (logic) level conversion?? To interconnect any two logic level families,
their respective HIGHs and LOWs must be same else they wouldn’t work. For
example, when we want to interconnect two devices, one of which works over TTL
and the other over RS232, we need to convert the HIGH of TTL (which is 3.3v~5v)
into the HIGH of RS232 (which is -3v ~ -25v) and similarly, the LOW of TTL
(0v~0.8v) into the low of RS232 (which is +3v ~ +25v). So you see, here lies the
problem! If we do not convert the logic levels (in this case) then the LOW signal of
TTL would be interpreted as a HIGH in RS232, making all the data transfer go
wrong!!
The Solution
One solution is to use additional pull-up resistors, or to use Zener diodes. A better
solution is the use of ICs that directly converts logic levels. Luckily logic level
conversion is quite simple these days with the use of ICs like MAX232 and CP2012!
We would talk about all these solutions one by one.

IC MAX232
MAX232 ICs were invented by Maxim. These IC packages are used to convert
TTL/CMOS logics to RS232 logic directly! All we need are some passive
components, and we are done! Below is the circuit diagram of the MAX232 IC.

Level Conversion using MAX232

MAX232 is used to convert TTL to RS232, and vice-versa as shown in the above
circuit diagram. But these days, USB is the most used protocol! Everything runs on
USB – be it printer, scanner, displays or anything! But how to convert USB to
UART? One way is USB → TTL → UART. The other way is to use USB-UART
bridges which directly convert USB → UART. They are widely and easily available
these days. Here are some of the websites:Robokits, eXtreme
Electronics, Sparkfun, Adafruit etc.
All these devices work on CP210x based USB-UART conversions.

MAX232: Construction, Operation, Types Application and uses in


different Electronics Circuits.

What is MAX232?
Max232 is designed by Maxim Integrated Products. This IC is widely used in RS232
Communication systems in which the conversion of voltage level is required to make
TTL devices to be compatible with PC serial port and vice versa. This chip contains
charge pumps which pumps the voltage to the Desired Level. It can be powered by a
single +5 volt power supply and its output can reach +_7.5 volts.MAX232 comes in
16 Pin Dip and many other packages and it contains Dual Drivers. It can be used as
a hardware layer convertor for 2 systems to communicate simultaneously.Max232 is
one of the versatile IC to use in most of the signal voltage level conversion problems.

Construction of MAX232:
Mostly MAX232 used in 16-pin DIP package. it consist of 3 major blocks .It can only
be powered by 5 volts to make it power supply compatible with most of the
embedded systems. First block is the voltage doubler in this ic switched capacitor
techniques is used to make the voltage double .Once the voltage is doubled second
block will converts that voltage to +10 and -10. The third block consists of 2
transmitters and 2 receivers which actually convert the voltage levels.

External components:
Max232 requires minimum 4 external capacitor. Their Value can range from 1uf to
10uf and16 volts or more rating. There are many different versions of this versatile ic
available each of them Require different capacitor value for proper working.

Application and uses of MAX232:


Premierly MAX232 is used in Serial communication. Problem arises when we have
to communicate between TTL logic and CMOS logic based systems. RS232 is
internationally defined standard named as EIA/TIA-232-E and in this standard logic 0
is the voltage between +3 to +15 and logic 1 is defined as the voltage between -3 to
-15.In TTL logic 0 is defined is by 0 volt and 1 is defined by 5 volt so in this scenario
this is a very handy IC to be incorporated.

Other Applications & Uses


 Battery Powered RS 232 Systems
 Interface Translation
 Low Power Modems
 RS 232 Networks (Multidrop)
 Portable Computing
Also Read:  Automatic Street Light Control system
PC Serial PORT communication by using MAX232 IC:
Desktop and some old Laptops have Serial port which comes in DB9 package. In
Most of the Circuits designer is concerned about the Tx and Rx pins only so the
function of the rest of the pins are not used here mostly.

In the above circuit only one Driver is used and second driver can be used for other
purpose. TTL data is available on pin 12 and pin 11 and these pins can be attached
to Microcontroller or any system which accept TTL logic.

GSM Modem Communication:


There are many GSM modems available in the market and most of them are on TTL
logic but some of them use RS232 standards and again it becomes a problem to
communicate wilt GSM modem by using Micro controller, aurdino or any other TTL
platform.MAX232 is used to solve this problem.

Types of MAX232:
1)“MAX232N” where “N” Represent PDIP package Style this package is easy to sold
and most widely used.

2) MAX232D where “D” indicates the SOIC package which is difficult to sold and
required a trained professional to be used correctly.

Common mistakes:
 Capacitor voltage rating is less than 16.
 Interchange Tx and Rx pins on one side of MAX232 at one time.
 Distorted power supply. Use decoupling capacitor to remove distortion.
 Check all the connections again.
 Check the capacitor with capacitance meter.
 Use Tantalum Capacitor for better performance.

IC MAX232
MAX232 ICs were invented by Maxim. These IC packages are used to convert
TTL/CMOS logics to RS232 logic directly! All we need are some passive
components, and we are done! Below is the circuit diagram of the MAX232 IC.
Level Conversion using MAX232

MAX232 is used to convert TTL to RS232, and vice-versa as shown in the above
circuit diagram. But these days, USB is the most used protocol! Everything runs on
USB – be it printer, scanner, displays or anything! But how to convert USB to
UART? One way is USB → TTL → UART. The other way is to use USB-UART
bridges which directly convert USB → UART. They are widely and easily available
these days. Here are some of the websites:Robokits, eXtreme
Electronics, Sparkfun, Adafruit etc.

All these devices work on CP210x based USB-UART conversions.


Add a 9-pin Serial Port to your Raspberry Pi in 10 Minutes
BY DAVEH | PUBLISHED 
APR
 
16
 
2013

Here’s how to add a 9-pin serial port to your Raspberry Pi, and it’ll
only take you 10 mins. Well, maybe a couple of weeks to wait for the part to arrive from

Hong Kong, but once it arrives, it’s only 10 minutes! 


Here’s the part you’ll need. It’s an RS232 to TTL converter module containing a
MAX3232 chip. The MAX3232 is important, as the older MAX232 won’t handle the 3.3v
levels of the Pi, whereas the Max3232 will. It comes with a 4-way cable for connecting
the module to the GPIO of your Pi. If you search on eBay for “RS232 Serial Port To TTL
Converter Module MAX3232” you should find several. The one I got cost me €3 with free
shipping from Hong Kong.

Here’s another view, showing the bottom of the module, indicating the +5V, GND, Tx
and Rx pins.

 
Simply attach the cable to the module, and connect to the 5V, GND, UART Rx and
UART Tx pins of the GPIO.
 Rs232
Null Modem Cables and Null Modem Adaptors. 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.

RS-232 devices may be classified as Data Terminal Equipment (DTE) or Data Circuit-terminating
Equipment (DCE); this defines at each device which wires will be sending and receiving each
signal. According to the standard, male connectors have DTE pin functions, and female
connectors have DCE pin functions. Other devices may have any combination of connector
gender and pin definitions. Many terminals were manufactured with female connectors but were
sold with a cable with male connectors at each end; the terminal with its cable satisfied the
recommendations in the standard.

A minimal "3-wire" RS-232 connection consisting only of transmit data, receive data, and ground,
is commonly used when the full facilities of RS-232 are not required. Even a two-wire connection
(data and ground) can be used if the data flow is one way (for example, a digital postal scale that
periodically sends a weight reading, or a GPS receiver that periodically sends position, if no
configuration via RS-232 is necessary). When only hardware flow control is required in addition
to two-way data, the RTS and CTS lines are added in a 5-wire version
The RTS and CTS signals were originally defined for use with half-duplex (one direction at a
time) modems that disable their transmitters when not required, and must transmit a
synchronization preamble to the receiver when they are re-enabled. The DTE asserts RTS to
indicate a desire to transmit to the DCE, and in response the DCE asserts CTS to grant
permission, once synchronization with the DCE at the far end is achieved. Such modems are no
longer in common use. There is no corresponding signal that the DTE could use to temporarily
halt incoming data from the DCE. Thus RS-232's use of the RTS and CTS signals, per the older
versions of the standard, is asymmetric.
This scheme is also employed in present-day RS-232 to RS-485 converters.

The ICUSB232V2 1 Port USB to Serial Adapter converts a USB port into an RS232 DB9 serial port to
connect to, monitor, and control a serial device.
Supporting data transfer rates up to 921.6 Kbps, the USB to serial cable is a convenient and cost-
saving solution for providing serial connectivity to devices such as point-of-sale terminals, serial
modems, industrial equipment, and a wide variety of other RS232 peripherals.

The USB to RS232 converter is easy to install and offers broad operating system compatibility,
including Windows® 8, Linux and Mac OS®, for easy integration into mixed environments.

GSM/GPRS MODEM -SIM900A – RS232 (RMC)


jithu July 5, 2013 GSM/GPRS
RhydoLABZ’s SIM900A GSM/GPRS MODEM -RS232 – RMC is same as the Part
No: GSM-1964  except the RMC Connector is populated instead of DB9 Connector.The
Modem  is built with Dual Band GSM/GPRS engine- SIM900, works on frequencies 900/
1800 MHz. The Modem is coming with RS232 interface,which allows you connect PC as
well as microcontroller with RS232 Chip(MAX232). The baud rate is configurable from
9600-115200 through AT command. The GSM/GPRS Modem is having internal TCP/IP
stack to enable you to connect with internet via GPRS. It is suitable for SMS, Voice as well
as DATA transfer application in M2M interface.

The Modem is manufactured with Automatic Pick and place machine with high quality
standard.The onboard Low dropout 3A Power supply allows you to connect wide range
unregulated power supply. Using this modem,you can make audio calls, SMS, Read SMS,
attend the incoming calls and internet etc through simple AT commands.
Controller based embedded systems there might not be a DB9 connector for the RS232
standard,but the output still comes at RS232 logic level so in such cases it is better to use
modem available with RMC connector with other end having simply loose wires which we
can  either solder to board or else we can easily think of any other good idea to bring
connectivity to our system by simply having a glance at it!
 The SIM900A is a complete Dual-band GSM/GPRS solution in a SMT module which can be
embedded in the customer applications allowing you to benefit from small dimensions and
cost-effective solutions.Featuring an industry-standard interface, the SIM900A delivers
GSM/GPRS 900/1800MHz performance for voice, SMS, Data, and Fax in a small form
factor and with low power consumption. With a tiny configuration of 24mm x 24mm x 3 mm,
SIM900A can fit almost all the space requirements in your applications, especially for slim
and compact demand of design.
Note:This Modem is meant for Asian countries only

Features:

 High Quality Product (Not hobby grade)


 RS232 interface @ RMC Connector for direct communication with computer or MCU
kit
 Configurable baud rate
 SMA connector with GSM Antenna.
 SIM Card holder.
 Built in Network Status LED
 Inbuilt Powerful TCP/IP protocol stack for internet data transfer over GPRS.
 Audio interface Connector
 Normal operation temperature: -20 °C to +55 °C
 Input Voltage: 4.5V-12V DC
Specification:
Pin Diagram:
Pin Details:
Layout:

RS232 null modem cables

The easiest way to connect two PC's is using an RS232 null modem cable. The only problem
is the large variety of RS232 null modem cables available. For simple connections, a three
line RS232 cable connecting the signal ground and receive and transmit lines is sufficient.
Depending of the software used, some sort of handshaking may however be necessary. Use
the RS232 null modem selection table to find the right null modem cable for each purpose.
For a Windows 95/98/ME Direct Cable Connection, the RS232 null modem cable with loop
back handshaking is a good choice.

RS232 null modem cables with handshaking can be defined in numerous ways, with loopback
handshaking to each PC, or complete handshaking between the two systems. The most
common null modem cable types are shown here.

Simple RS232 null modem without handshaking (Null modem explanation)

Connector Connector
Function
1 2

2 3 Rx Tx

3 2 Tx Rx
5 5 Signal ground
RS232 null modem with loop back handshaking (Null modem explanation)

I have connected Raspberry Pi to GSM sim900a mini with the following details:


 convertor max3232 used
 DB9-2 sim900a connected to DB9-3 max3232
 DB9-3 sim900a connected to DB9-2 max3232
 tx (raspberry) connected to tx (max3232)
 rx (raspberry) connected to rx (max3232)

You might also like