Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 1.4 KB

index.rst

File metadata and controls

37 lines (24 loc) · 1.4 KB

RS485

https://en.wikipedia.org/wiki/RS-485

RS485 is a very inexpensive way to wire devices together in a network. A single twisted pair (such as two wires from regular UTP network cable) at low speeds can operate over a kilometre.

Devices must be daisy-chained together, and long runs should be properly terminated typically with 120 ohm resistors at either end.

Connecting devices in star topology causes signal reflections and generally won't work except for very short runs.

One solution is to use multiple MAX485 (or similar) transceivers to create multiple physical network segments. Only one UART is required unless you need concurrent requests.

multiplex.png

This example allows for one transceiver to be in receive mode, with others in transmit. That means slave addresses must be unique across both segments. Resistors R2 and R8 are current limit resistors to guard against both transceivers being switched into receive mode at the same time.

The logic for controlling this would be in a callback registered via :cpp:func:`IO::RS485::Controller::onSetDirection`.

For completeness, here's example connections for a 3.3v transceiver:

max485.png

R22 is optional, typically installed only on longer runs. D3 is additional transient protection - always a good idea as a first line of defence even if the transceiver itself has some built in.

.. doxygennamespace:: IO::RS485
   :members: