Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

UART and RS-232 Relationship

Status
Not open for further replies.

ahmedsaber

Junior Member level 1
Joined
Mar 11, 2013
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Al Jizah, Egypt
Activity points
1,449
hey all

i need some help please

i know that UART is a h.w device represents a communication protocol
but
1 - what is RS-232 ? is it protocol ? or just interface ? what is meant by interface ?

2 - if Rs-232 is interface for serial communication why we can't use it with SPI , I2C ?

3 - if it is an interface to map MC voltage Level to communicate with other devices such as PC's
so why we still use MAX-232 ?

thanks
 

RS-232 is a standard for serial communication transmission of data.
See https://en.wikipedia.org/wiki/RS-232

Yes, it's primarily an interface standard (voltage levels, connectors, but also contains timing specifications related to serial communication).

RS-232 interfaces could be used for (point to point only) SPI, but not for I2C which requires special bidirectional drivers. RS-232 has limited benefit for SPI. More often RS-422 or RS-485 interface is used for longer distance SPI.

MAX232 and similar drivers translate between RS-232 and TTL/CMOS UART voltage levels. They are required to connect a 5V UART component to standard RS-232 communication devices.
 

still i'm so confused about differentiation between Rs generally and the protocol itself
e.g
if i wanna to make serial comm between two MC's with UART where and what is the role of the uart module as a h.w device and the role of RS
 

The UART serializes the byte to send and takes care of the timing and preamble/postamble. The MAX232 or similar receives the TTL level signals and passes it on as RS-232 level signals and vice-versa.

If what you want is to have two MCUs communicating in the same circuit you can dispense with the level-shifter and connect them directly, TX(1) -> RX(2) and RX(1) <- TX(2). There are also some options for multi-drop, look them up.
 

1.RS-232 is a standard for serial communication.
The standard include both protocol and interface.

'protocol' is the specification for software format.
(how the data is sent)

'interface ' is the specification of HW(like connectors , cables ...)
(about the voltage levels and which pin which signal...)

In practice ,we use both the terms .

The standard itself is very old , dating back to UNIX days.

But we make use of it in PCs also.

2. RS-232 , SPI and I2c all comes under serial form of data.
But the the 'protocol' part differs betwen them.

3. If you have two PCs connected by RS-232 connectors , MAX232 is not required.

MAX 232 translates the voltage levels alone.
5v (and 0v) to +12 and -12v and vice versa.

RS232 specifies +12 and -12 for data transfer.
But the microcontroller or any digital system operate only in 5v.
So we include an MAX232 between controller and RS232 interface.
 

why we need to use RS ? if we need to make a communication between two Micro controllers containing UART modules why we don't simply use two wires between the uart module?
 

why we need to use RS ? if we need to make a communication between two Micro controllers containing UART modules why we don't simply use two wires between the uart module?

This would be similar to the cable I used to send data from my VIC-20 to my Macintosh. I made a 'null modem'. It only needed two wires. It ignored the handshaking protocols because I put jumpers across certain pins at each end.

I sent data from the VIC-20 by invoking the COMM keyword, then LISTing a program. On the Macintosh I used one of the popular communication programs. The Mac received everything that came through. I did not need to know the RS232 protocol. I barely knew what I was doing.

One computer sent DC pulses representing ascii values. The other computer automatically interpreted the waveforms as ascii values. I did need to set both computers to the same baud rate, number of data bits, stop bits, parity check, full or half duplex, etc. At first I saw only occasional gibberish characters appear. It required hours of experimentation before one computer sent sensible data, and the other computer interpreted it sensibly.

To make the cable, it took a lot of study to figure out pinouts of the serial ports. I had to wire serial connectors. I had to reduce transmission voltage. I only got success after I installed an inverter to invert signal. An oscilloscope was invaluable to know whether any signal was getting through at all.
 

why we need to use RS ? if we need to make a communication between two Micro controllers containing UART modules why we don't simply use two wires between the uart module?
Like all good answers, this one begins "it depends"
If the UARTs are relatively close to each other - say a few centimetres - then you can connect then together directly (assuming they have the same voltages).
The advantage of RS232 (and one of the reasons it was created) is that it can reliably send signals over much longer distances of 10's or even 100's of metres. There are other electrical standards that let you communicate over longer distances reliably as well.
Also the speed of the connection comes in to this as well. 1200 baud will let you talk over longer distances than 921600 reliably as the impedance of the line will interfere less with the signal.
Susan
It all comes down to your situation.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top