Monday 27 April 2015

RS 485 description and Interfacing with Micro-controller

Introduction to RS-485

RS-485 is a multipoint communications standard set by the Electronics Industry Alliance (EIA) and Telecommunications Industry Association (TIA). RS-485 supports several connection types, including DB-9 and DB-37. Because of lower impedance receivers and drivers, RS-485 supports more nodes per line than RS-422.

RS-485 is also known as EIA-485 or TIA-485.RS-485 is effective in applications with significant electrical interference (noise) requiring a long transmission distance. Thus, the standard is often used in industrial applications. It is as an inexpensive local area network (LAN) connection that allows multiple receivers to connect within a multidrop configuration. RS-485 does not include a communications protocol.

Data transmission rates range from 35 Mbps (up to 33 feet)-100 Kbps (up to 4,000 feet). Because star and ring configurations are not recommended, equipment installed along RS-485 transmission lines (known as nodes, stations or devices) are connected as series. However, if necessary, star or ring configurations may be accommodated with special star/hub repeaters.

RS-485 uses a two-wire twisted pair bus. Although not always required, RS-485, like RS-422, may be configured with four wires as full-duplex. With certain restrictions, RS-422 and RS-485 may be co-configured.

Additionally, the RS-485 specification is used by Small Computer System Interface (SCSI)-2 and SCSI-3. RS-485 also may be used to allow remote connectivity between PCs and remote devices.

Connections of RS485
Figure 1: 2-Wire RS-485 Connections
Figure: 4-Wire Connections
 Interfacing with Micro-controller

The microcontrollers’ capabilities can be extended to communicate with other devices such as sensors, motors, switches, memories, etc., with proprietary circuits, but the circuit complexity and power consumption will be increased.
In order to overcome this problem, the protocol concept comes into the picture for reducing the circuit complexity. There are various types of serial communications that exist such as RS-232, I2C, SPI, RS-485 protocol, and so on. Among these, the RS-485 serial protocol is mostly used for high-speed and long- distance data transmission.
The RS-485 protocol is most commonly used in master to slave  or slave to slave communication wherein the master can be any type controller like  8051 microcontroller, and the slave devices can be various peripherals like ADC, EEPROM, DAC and other similar devices in the embedded system. A number of slave devices are connected to the master device with the help of the RS-485 serial bus, wherein each slave consists of a unique address to communicate with it. The following steps are used to communicate the master device to the slave:
RS-485 Master and Slave interface
RS-485 Master and Slave interface
Step1: First, the master device issues a start condition to inform all the slave devices so that they listen on the serial data line.
Step2: The master device sends the address of the target slave device which is compared with all the slave devices addresses as connected to the Tx+ and RX- lines. If any of the address matches, that device is selected.
Step3: The slave device is matched with the received address from the master, and thereafter the communication is established between both the master and slave devices on the data bus.
Step4: Both the master and slave receive and transmit the data depending on whether the communication is read or write.Then, the master can transmit 8-bit of data to the receiver.
A slave-to-slave communication like a master to slave communication, but master slave communication has slave nodes that cannot communicate with each other. In the slave-to-slave communication, each node can communicate to all other salves devices through an address.

Master to Slave Write operation:

The master and slave devices are interchange the packets of information serially by the RS-485 communication. Each packet contains the synchronization of bytes: address bytes and data bytes. Each slave has a unique address to receive the packets of data. The communication always initiates from the master device.

Advantages of RS-485 Communication

  • The RS-485 supports long distance up to 1200 meters. The speed of the communication is 1Mbp/s
  • It is protected from noise due to differential voltages
  • It is widely used in industrial automation and other wireless sensor networks
  • It has higher speed beyond 115200 baud rate
  • It allows 32 slave devices to communicate  at a time on the same data line
  • It is more suitable for system-to-system communication

                                                                                                                           Tanay Jani
                                                                                                                     BE-Q-21
                                                                                                            

No comments:

Post a Comment