RS-485 is a half-duplex communication standard defining the electrical characteristics of drivers and receivers for use in serial communications systems. It is a differential protocol designed for use in environments requiring especially robust communication.
Differential signaling is the method where information is transmitted using two complementary signals. The host converts a fundamental signal into a pair, the original, and its inverse (or complement). RS-485 requires the use of twisted-pair wiring where two wires are intertwined a specific number of times over the cable's length. When noise couples onto a twisted-pair cable, it presents itself the same on each wire.
When the receiver gets the complementary pair, a subtractor is used to find the difference between the two wires (hence the name differential), and because the added noise is the same on both wires, it is not present in the result of the equation, yielding only the fundamental signal. Because the receiver cares only about the difference between the two cables, the voltage levels of the system no longer matter. Therefore, a 3.3 V system can work on the same system as 12 V devices, so long as they all follow RS-485 requirements.
RS-485 has a shared bus but differs from SPI. In an RS-485 network, all devices share the same 2 wires labeled A and B. Each device has an RS-485 transceiver that manages communication with the bus and can be controlled by the processor of the host system. In most cases the host system may use serial UART to talk to the RS-485 transceiver, where the host tells the transceiver when to talk and when to listen. Because all devices share the same bus, each device must have its own unique node address. The host will put its transceiver in transmit mode, and then send the node address. Immediately after this it will put the transceiver in receive mode and listen for the response. Only one device can control the bus at a time which is why the transceiver must not change modes.
This last image illustrates what a position request looks like with the AMT21 absolute RS-485 encoder series. A and B are the complementary pairs. The host controls the bus by sending the node address 0x54 to an encoder on the bus and within microseconds that encoder responds with its current position.
Benefits of RS-485
RS-485 is a rugged option originally designed for use in telecom and industrial applications. Its smaller host system only requires one communication bus and is well-suited for noisy environments or applications where the encoder must be far away from the host. The RS-485 protocol also allows the encoder to respond with position information in microseconds.
Smaller Host System
- Only one communication bus is required in the host system
- The host only needs to control its transceiver, and doesn't require unique chip select pins for each device
- RS-485 is well suited for when encoders must be far away from the host
- Works well in electrically noisy environments
- Originally designed for use in telecom and industrial applications
- Very fast protocol
- Encoder responds with position within microseconds
- Digital serial protocol supports the inclusion of an error checking code into the position response allowing for greater assurance that the host received exactly what the slave sent
AMT21 Series - RS-485 Encoder
The AMT21 series is the fastest encoder in the AMT absolute encoder line. This encoder offers high resolution position at 12 or 14 bits, comes with radial or axial connector orientations, and has a very simple command protocol. The AMT21 encoder offers multi-turn capability with the ability to track the number of rotations in either direction.
- 12 bit (4096 positions) or 14 bit (16384 positions)
- Single-turn or multi-turn output options
- Wide operating temperature range from -40 up to +105°C
- Low profile depth of 11 mm
- Light-weight mechanical design of 15 g
- Low current usage less than 20 mA
- Programmable zero position over RS-485
- Robust design
- Adapts to 9 common shaft diameters
- Firmware updates and configuration with AMT Viewpoint™ PC Software
Single-Turn vs. Multi-Turn Encoders
CUI Devices' AMT21 absolute encoder series comes in single-turn and multi-turn variations. Single-turn encoders provide positioning data over one full revolution, 360°, with the output repeating for every revolution of the shaft. Multi-turn encoders also provide positioning data over a single turn, but have an additional “turns” counter that measures the number of revolutions. In the AMT21 multi-turn version, this turns counter is a 14-bit signed number plus two checkbits for error detection with a battery backup required to prevent loss of the turns count. The turns count is read in the same format as position and allows for -8192 to +8191 turns.