RS485 is an alternatve for RS232 for long distances. Maximum length of the cable for RS232 is only 15m. For RS485 it is about 1200m. In addition you can connect many devices to RS485 bus (unlike RS232 — only 2).
For RS232, MAX232 chip is used. For RS485 you can use one of these chips:
- MAX485 or DS485 (National Semiconductor equivalent), cost less then 1€
- SN75176, cost less than 1&euro
According to Maxim (producer of MAX485)
- Benefits of the MAX485 transceiver over the SN75176: 1mA supply current.
- Benefits of the SN75176 transceiver over the MAX485: 5Mbps data rate.
Maxim comparsion page is located http://www.maxim-ic.com/alternatives.cfm/part/SN75176/pk/15.
If your control system needs to receiving and sending data in the same time you must use full duplex transmission mode. It is possible (and in real world this is the most popular case) that control system first sends request message to ROV (e.g. get temperature) and than waits for the response. In this scenario, there is no possibility that control system and ROV sends data in the same time, so half duplex communication is sufficient.
For full duplex communication you need 4 wires, for half duplex only 2 wires.
Both MAX485 and SN75176 are providing half duplex mode. If you need to use full duplex you must use 2 units (or full duplex chip).
MAX485 connected to Atmel ATmega8 for half duplex connection. PD2 changes send/receive modes.
For practical implementation of RS485 interface on MAX232 you can look at ROV Control Unit project.
RS485 bus must be terminated on the ends for long lines. By default it is 120Ω resistor. If there are more then 2 devices on the bus, terminator is needed only on the first and last unit. Terminator can be omitted for short lines.
In the example above, 120Ω resistor should be connected between X1-1 and X1-2.
There are many devices that can convert serial data interface like RS-232 or USB to RS-485. Half duplex devices needs additional unit that switches between send/receive modes. Sometimes it leads to problems when converter improperly switch modes. Simple solution can use RTS or DTR lines of RS-232.
If you want simple solution you can look Aquaticus half duplex RS485 to RS232 converter.
Other converter is available on Airborn electronics webpage.