Since the beginning of the communication between different devices,different standards were developed to send the data.One of the standard is known as RS232 communication standard.An RS232 serial port was once an important part of the computer devices.It was used to connect the computers with modems,mouses etc.. But now it had been replaced by the USB serial port as USB is really fast in transmission compared with RS232. It is still widely used in Scientific instruments,industrial machines.We can use RS232 protocol to connect the microprocessor to the computer.

RS232 is an asynchronous serial communication protocol.Let’s see what is serial communication and asynchronous communication,

Serial Communication- In serial communication,the whole data unit ,for example 1 byte is transmitted as 1 bit at a time whereas in parallel communication, 1 byte is send at once. Therefore,serial communication requires one wire and hence useful in long range transmission whereas parallel requires multiple wires as it send data through different wires simultaneously and used in short range transmission.

Synchronization- While transmitting the data,it is really necessary to know that where the data starts from and where does it ends.

One way of knowing it is by using Clock for synchronization.In this ,a clock line is added to synchronize the communication.This method is used in communication protocols like as SPI, I2C.

The other way is to use a start and stop bit with the data.This method is used in UART(Universal Asynchronous Receiver Transmitter)

Untitled-4

Now,are you thinking that RS232 and UART are same??

No,there is difference between UART and RS232.

UART is responsible for sending and receiving the bits.At the output of UART,bits are represented in logic level voltages.These bits can become RS-232, RS-422, RS-485.

But RS232 specifies voltage levels i.e. HIGH=-12V and LOW =+12V

A microcontroller UART can not generate such voltages levels by itself. This is done with help of an additional component: RS-232 line driver. A classic example of an RS-232 line driver is MAX232.

As there is no synchronization used in RS232,the data is transmitted at several standard speeds.The speeds are measured in bits per second. Number of bits transmitted is  known as baud rate.

Some standard baud rates are

  • 1200
  • 2400
  • 4800
  • 9600
  • 19200
  • 38400
  • 57600
  • 115200

Hope this tutorial helps you in understanding the basic of RS232 communication.See you in the next tutorial. 🙂

Advertisements