Serial Port Complete - Latest Microcontroller projects

(lily) #1
Inside RS-485

 

  




As with RS-232, you can add an RS-485 port to a PC by installing an expan-
sion card or PC Card or attaching a USB converter. You can also convert an
RS-232 or TTL serial port to RS-485. RS-485 ports typically appear as COM
ports in PCs. Some cards and converters have ports with one pair of data lines
for half-duplex communications, while others have two pairs for full duplex
communications. Some half-duplex ports include hardware support for auto-
matically enabling the driver when needed.

 8  
/=#:
% 


The asynchronous serial port on a microcontroller can use 3.3V CMOS or 5V
TTL/CMOS logic levels. There are several ways to convert between 3.3/5V
logic and RS-485.

.    
Most RS-485 lines are half-duplex, where multiple drivers and receivers share a
signal path. But you can also use RS-485 in a full-duplex line, where each direc-
tion has its own signal path. As long as you include any required flow-control
signals in the interface, you can swap an RS-232 line for a full-duplex RS-485
with no changes to the software or firmware that uses the interface. Both can
use the same programming, though RS-485 supports higher bit rates and the
hardware allows longer cables.
For a full-duplex line, you can use the Texas Instruments SN75179B or similar
chips. The SN75179B contains a driver that translates 5V TTL signals to
RS-485 and a receiver that translates RS-485 back to 5V TTL. Figure 6-7 illus-
trates.
This chip is a solution when you want to create a long-distance, full-duplex link
between microcontrollers. The RS-485 interface chips are smaller and cheaper
than RS-232 interface chips. You can also use RS-422 interface chips for this
type of link.
Figure 6-8 shows how to use multiple drivers and receivers in full-duplex com-
munications. One arrangement is in a primary/secondary network, where a pri-
mary computer (Node 0 in the figure) has control of the network and grants
the secondary computers (Nodes 1 and higher) permission to transmit. One
pair of wires connects Node 0’s driver to all of the secondary nodes’ receivers. In
the other direction, another pair of wires connects all of the secondary nodes’
Free download pdf