RS-232 and RS-232 protocol

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
I am little bit confused with “RS-232 protocol” As understand RS-232 is integrated circuit that is used to transmit data from one equipment to another or receive data from one equipment to another. One of example is rs232 used to transmit data from PC to microcontroller. RS-232 allows for both transmit and receive circuit.

I did google search and got little bit information. RS-232 is a standard protocol for serial data communication between two equipment by reading some pages. I am too confuse with 232 protocol What is –RS-232 protocol?
 

nsaspook

Joined Aug 27, 2009
16,298
RS-232 refers to a series of related standards for the electrical interface and signalling of a specific serial interface that interface hardware (MAX232 chip) is designed to conform with. ISO physical layer-1.
https://en.wikipedia.org/wiki/OSI_model#Layer_1:_Physical_Layer
The physical layer defines the electrical and physical specifications of the data connection. It defines the relationship between a device and a physical transmission medium (for example, an electrical cable, an optical fiber cable, or a radio frequency link). This includes the layout of pins, voltages, line impedance, cable specifications, signal timing and similar characteristics for connected devices and frequency (5 GHz or 2.4 GHz etc.) for wireless devices. It is responsible for transmission and reception of unstructured raw data in a physical medium. Bit rate control is done at the physical layer. It may define transmission mode as simplex, half duplex, and full duplex. It defines the network topology as bus, mesh, or ring being some of the most common.

The physical layer is the layer of low-level networking equipment, such as some hubs, cabling, and repeaters. The physical layer is never concerned with protocols or other such higher-layer items. Examples of hardware in this layer are network adapters, repeaters, network hubs, modems, and fiber media converters.
It's not a communications protocol.
 
Last edited:

MrChips

Joined Oct 2, 2009
34,765
As nsaspook says, RS-232, RS-422, and RS-485 are specifications of the electrical signal, i.e. voltages, current, impedance, rise and fall times. These are not communications protocols.

The "RS-232 protocol" was used as a description of how printers, terminals, modems, and computers might be connected using a DB-25 or DE-9 connector via a "comm port". The standard for transmitting serial data is with the use of a UART, ACIA, SCI, etc. using NRZI signalling convention.

There is no standard on how data is put into a "packet" for transmission.

"Hayes command" may be considered a communications protocol which was developed in order to communicate with Hayes Communications modems.
 

MaxHeadRoom

Joined Jul 18, 2013
30,628
The original RS232 25D or the later 9D COM port itself was designated with the physical connection labels for DTE and DCE devices, (Data Terminal Equipment and Data Connection Equipment ), the 25 designations later reduced to 9, the generally accepted communication methods itself have many settable options such as Baud rate, Handshake type etc. for the actual protocol.
So as previous stated, RS232 per-se does not indicate the the protocols used.
Max.
 

nsaspook

Joined Aug 27, 2009
16,298
hi nsaspook,
I am surprised to see that you do not consider a RS232, a communications protocol.?
Eric
https://circuitdigest.com/article/rs232-serial-communication-protocol-basics-specifications
RS-232 is specifically not a 'communications' protocol. An example that uses the RS-232 interface as one type of physical interface is the old X10 system.

The X10 'Firecracker' module used the DB9 RS-232 physical interface standard to transfer X10 communications protocol messages from a computer to the X10 RF physical interface , those messages were decoded at the receiver module into X10 module on/off/dimmer commands while maybe also sending those communication protocol messages via the X10 AC powerline physical interface to a remote on/off/dimmer.

https://en.wikipedia.org/wiki/X10_(industry_standard)#Physical_layer_details
http://web.archive.org/web/20040326...ties.com/ido_bartana/Firecracker_protocol.htm

A PIC18f1320 embedded application that used the 'Firecracker' module.
https://github.com/nsaspook/PAT1320/tree/master/pat



 

MaxHeadRoom

Joined Jul 18, 2013
30,628
I remember years ago when it was in general use, there was a saying, the good thing about the RS232 standard, There is none!;)
Max.
 
Last edited:

MrChips

Joined Oct 2, 2009
34,765
Let's not get hung up on what is and what isn't a protocol. When we think of RS-232, there are actually four stages (or layers) that are often referred to as RS-232 (aka serial data communications).

1) UART, USART, ACIA, SCI, etc. This refers to the serial data standard sometimes with the labels NRZ and NRZI. Here we need to consider number of bits, start, stop, parity, baud, flow control, etc.

2) Hardware line converters, e.g. MC1488, MC1489, MAX232, RS232 chips etc. This is the physical device receivers and drivers that determine the transmitted voltages, currents, data slew, distance, bit rates.

3) DB-25, DE-9, serial COM ports, RTS, CTS, DTR, DSR, RI, etc. These are established (legacy) standards set by the telecommunications industry on data communications devices such as modems, terminals, computers, etc.

4) Data encoding and framing. There are many protocols in existence that packet/frame/encapsulate the data within an entire sequence of bytes. This encapsulation may include synchronization, sender ID, receiver ID, command, data, checksum, end-of-message. Hayes command, MODBUS, GPS, etc., are examples of command/data encapsulation.
 

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
1) UART, USART, ACIA, SCI, etc. This refers to the serial data standard sometimes with the labels NRZ and NRZI. Here we need to consider number of bits, start, stop, parity, baud, flow control, etc.
Okay so Rs232 is chip only it's not protocol. Uart is protocol and Rs232 is chip. When we send data from PC to microcontroller there we connect rs232 chip between PC to Microcontroller with db connector.

Uart protocol perform on Rs232 chip. Does it happen really?
 

nsaspook

Joined Aug 27, 2009
16,298
In the formal ISO model the USART is the data link layer. (layer 2)

http://ucpros.com/work samples/Microcontroller Communication Interfaces 3.htm
U(S)ART
The oldest and still most predominant asynchronous interface is the UART (Universal Asynchronous Receiver Transmitter). Some implementations support both a synchronous and asynchronous mode - then it is a USART (Universal Synchronous Asynchronous Receiver Transmitter). The same thing with just a different name is the Serial Communication Interface (SCI). With reference to the OSI model, a UART implements the data link layer (layer 2). The physical layer (layer1) is covered by several driver standards that all utilize the UART data link layer, among the most popular are RS232C, RS485 and RS422.

USARTs that are integrated on microcontrollers support data rates ranging from a few hundred bits per second (bps) up to 1.5Mbps. UART systems are typically either pure point-to-point connections of 2 devices (RS232C), or single master- multiple slave bus systems (RS422, RS485). It is possible to built multi-master RS422 and RS485 systems, but it requires the development of your own software protocol to handle bus arbitration (in case multiple masters want to send at the same time). Other interfaces, like CAN and Ethernet, handle bus arbitration in hardware and are therefore better suited for multi-master systems.


A typical Ethernet ISO stack.


http://us.profinet.com/ethernet-is-not-a-protocol/

 
Last edited:

miniwinwm

Joined Feb 2, 2018
68
Uart is protocol and Rs232 is chip.
A U(S)ART is not a protocol. It's now usually a hardware module on a microcontroller, although it could be a separate chip. RS-232 is not a chip; it's a standard, now renamed to TIA-232, that describes voltage levels and connecting wire names and purposes. TIA-232 is nothing to do with U(S)ARTS. A U(S)ART creates a stream of voltage pulses at the processor's voltage levels which an external chip (like a MAX-232) converts to pulses which meet the electrical requirements of TIA-232.
 

be80be

Joined Jul 5, 2008
2,395
Thats what there calling it tho in schools and collages
Screenshot from 2018-03-14 08-00-31.png

[paste:font size="5"]23 shows the relationship between the various components in a serial ink. These components are the UART, the serial channel, and the interface logic. An interface chip known as the universal asynchronous receiver/transmitter or UART is used to implement serial data transmission. The UART sits between the host computer and the serial channel. The serial channel is the collection of wires over which the bits are transmitted. The output from the UART is a standard TTL/CMOS logic level of 0 or 5 volts. In order to improve bandwidth, remove noise, and increase range, this TTL logical level is converted to an RS-232 logic level of
or
volts before being sent out on the serial channel. This conversion is done by the interface logic shown in figure 23. In your system the interface logic is implemented by the comm stamp.

A frame is a complete and nondivisible packet of bits. A frame includes both information (e.g., data and characters) and overhead (e.g., start bit, error checking and stop bits). In asynchronous serial protocols such as RS-232, the frame consists of one start bit, seven or eight data bits, parity bits, and stop bits. A timing diagram for an RS-232 frame consisting of one start bit, 7 data bits, one parity bits and two stop bits is shown below in figure 24. Note that the exact structure of the frame must be agreed upon by both transmitter and receiver before the comm-link must be opened.

Most of the bits in a frame are self-explanatory. The start bit is used to signal the beginning of a frame and the stop bit is used to signal the end of a frame. The only bit that probably needs a bit of explanation is the parity bit. Parity is used to detect transmission errors. For even parity checking, the number of 1's in the data plus the parity bit must equal an even number. For odd parity, this sum must be an odd number. Parity bits are used to detect errors in transmitted data. Before sending out a frame, the transmitter sets the parity bit so that the frame has either even or odd parity. The receiver and transmitter have already agreed upon which type of parity check (even or odd) is being used. When the frame is received, then the receiver checks the parity of the received frame. If the parity is wrong, then the receiver knows an error occurred in transmission and the receiver can request that the transmitter re-send the frame.

In cases where the probability of error is extremely small, then it is customary to ignore the parity bit. For communication between the MicroStamp11 and the host computer, this is usually the case and so we ignore the parity bit.

The bit time is the basic unit of time used in serial communication. It is the time between each bit. The transmitter outputs a bit, waits one bit time and then outputs the next bit. The start bit is used to synchronize the transmitter and receiver. After the receiver senses the true-false transition in the start bit, it waits one half bit time and then starts reading the serial line once every bit time after that. The baud rate is the total number of bits (information, overhead, and idle) per time that is transmitted over the serial link. So we can compute the baud rate as the reciprocal of the bit time.
 
Last edited:

MrChips

Joined Oct 2, 2009
34,765
As I stated on my opening sentence on post #12, you are getting hung up on the semantics and meaning of the word "protocol".

What is the definition of "protocol"?

Quoted from Mariam-Webster:

3 b: a set of conventions governing the treatment and especially the formatting of data in an electronic communications system - network protocols.

A protocol is a set of rules, standard, agreement.

Of the four layers I described:
  • UART
  • RS-232 receiver/driver
  • DCE/DTE communications
  • Data encapsulation
each one is an agreement between two parties, the transmitter and the receiver. Each one can be called a protocol or standard.

Can we not use the word "protocol" for describing RS-232 because it confuscates the issue? We can use the word "standard" instead. But that simply replaces one word with another that has the similar meaning.
 

MrChips

Joined Oct 2, 2009
34,765
There are many terms used historically that no longer make any sense.

The ones that come to mind immediately are:

TTL vs CMOS

RAM vs ROM
 
Top